Alvaro Herrera <[EMAIL PROTECTED]> writes:
> Well, it's on the SQL standard, so we should look forward to
> implementing (some form of) it some day.
Do *any* databases implement SQL standard Assertions?
--
greg
---(end of broadcast)---
TIP 5: do
well with the gist indexes. It does require changing your data
model denormalizing it slightly which makes it hard to "reparent" children,
but if that isn't an operation you have to support I think it makes most other
operations you might want to do much easier to support.
uilt
> for 8.2 and installed, but I haven't tried using them.
>
> I would think that connectby is at least worth looking into.
Uhm, no, I guess I'm not sure. I didn't realize it was in the tablefunc module
either.
--
Gregory Stark
EnterpriseDB http://www.ente
rent definition. Something like
this for example:
SELECT inspection_id, meter_id,
case when bay=1 then bay_1_use
when bay=2 then bay_2_use
when bay=3 then bay_3_use
when bay=4 then bay_4_use
when bay=5 then bay_5_use
else null
ocation support isn't exactly a strong point in
Postgres either. Plenty of people get bitten by their database being initdb'd
in a locale they didn't expect.
--
Gregory Stark
EnterpriseDB http://www.enterprisedb.com
---(end of broadcast)---
TIP 5: don't forget to increase your free space map settings
iple times because there are multiple join matches.
--
Gregory Stark
EnterpriseDB http://www.enterprisedb.com
---(end of broadcast)---
TIP 6: explain analyze is your friend
wait until the trigger on B is executed if the trigger on B doesn't
actually get triggered until someone updates B and it's the trigger on A
doing the update?
--
Gregory Stark
EnterpriseDB http://www.enterprisedb.com
---(end of broadcast)--
umeric / (select count(*) from basket) * 100,
0)::text||'%' as "%"
from basket
group by fruit_name
order by "%";
fruit_name | count | %
+---+-
Bananas| 5 | 10%
Apples | 15 | 30%
Oranges|30 | 60%
(3 rows)
--
in Postgres too. But the defined aliases are only in the resulting
output columns, not in scope for the where clause. In fact the expressions
used aren't even evaluated for rows which don't match the where clause which
is pretty important if those expressions are subqueries or volatile funct
even in the one which you label "without date_trunc".
Instead try to write a where clause that the database can understand the end
points of. Something like (col >= '20070703' and col < '20070704'). That's
something the database can apply a normal in
happen because it simply does
not have that information.
The more I look at this view the more I think it's just seriously broken.
Why is it grouping by order_id at all if, I suspect, there will only be one
record per order_id in eg_orders??
--
Gregory Stark
Enter
;s a hypothetical data set for which this algorithm fails:
order_idinvoice_id mileage
1 1 100
1 2 100
Your algorithm would produce
order_id max(invoice_id) sum(mileage
"Gregory Stark" <[EMAIL PROTECTED]> writes:
> Nis Jørgensen <[EMAIL PROTECTED]> writes:
>
>> 1. Look up all order_ids for which (order_id,my_invoice_id) appear in
>> eg_orders
>>
>> 2. Find all rows (in both branches of the UNION) with these id
ent kinds of
records depending on the type of object.
--
Gregory Stark
EnterpriseDB http://www.enterprisedb.com
---(end of broadcast)---
TIP 6: explain analyze is your friend
g the varchar_pattern_ops?
The default operator set is the one you want for handling ordering. The
pattern_ops operator set is for handling things like x LIKE 'foo%'
--
Gregory Stark
EnterpriseDB http://www.enterprisedb.com
---(end of broadca
indexes...
If you initd in the C locale you only need one index. In other locales the
collation order and the pattern order are different.
--
Gregory Stark
EnterpriseDB http://www.enterprisedb.com
---(end of broadcast)---
TIP 4: Have you searched our list archives?
http://archives.postgresql.org
s record as 'select 1' language sql;
CREATE FUNCTION
postgres=# select * from testf() as (i integer);
i
---
1
(1 row)
I haven't quite figured out how this is useful though. It probably makes more
sense if you use plpgsql but I still don't quite see what the use case is.
--
Gr