Re: [GENERAL] left join with smaller table or index on (XXX is not null) to avoid upsert

2009-01-18 Thread Grzegorz Jaśkiewicz
2009/1/19 Scott Marlowe : > Submit a patch. :) > > But seriously, it's doing what you told it to do. There might be > corner cases where you need a trigger to fire for a row on change, and > short-circuiting could cause things to fail in unexpected ways. as far as my little knowledge about pg goes

Re: [GENERAL] left join with smaller table or index on (XXX is not null) to avoid upsert

2009-01-18 Thread Scott Marlowe
On Mon, Jan 19, 2009 at 12:12 AM, Grzegorz Jaśkiewicz wrote: > On Mon, Jan 19, 2009 at 2:44 AM, Scott Marlowe > wrote: >> Watch out for bloat when doing this. A simple where change of >> >> update table set b = 45 ; >> >> to >> >> update table set b = 45 where b <> 45 ; >> >> can save the db a

Re: [GENERAL] left join with smaller table or index on (XXX is not null) to avoid upsert

2009-01-18 Thread Grzegorz Jaśkiewicz
On Mon, Jan 19, 2009 at 2:44 AM, Scott Marlowe wrote: > Watch out for bloat when doing this. A simple where change of > > update table set b = 45 ; > > to > > update table set b = 45 where b <> 45 ; > > can save the db a lot of work, and if you can apply the same logic to > your update to save so

Re: [GENERAL] left join with smaller table or index on (XXX is not null) to avoid upsert

2009-01-18 Thread Scott Marlowe
On Sun, Jan 18, 2009 at 2:12 PM, Ivan Sergio Borgonovo wrote: > I've to apply a discounts to products. > > For each promotion I've a query that select a list of products and > should apply a discount. > > Queries may have intersections, in these intersections the highest > discount should be appli

Re: [GENERAL] left join with smaller table or index on (XXX is not null) to avoid upsert

2009-01-18 Thread Martin Gainty
Sergio- 1)Index all joined columns 2)Put your NOT NULL test up front e.g where pd.DiscountPrice is not null AND left join ProductDiscount pd on p.ProductID=pd.ProductID Martin __ Disclaimer and confidentiality note Everything in this e-mail and

Re: [GENERAL] Is this on the to-do list?

2009-01-18 Thread Thomas Kellerer
A B wrote on 18.01.2009 22:43: From the docs: http://www.postgresql.org/docs/8.3/interactive/sql-update.html "According to the standard, the column-list syntax should allow a list of columns to be assigned from a single row-valued expression, such as a sub-select: UPDATE accounts SET (contact_l

[GENERAL] Is this on the to-do list?

2009-01-18 Thread A B
>From the docs: http://www.postgresql.org/docs/8.3/interactive/sql-update.html "According to the standard, the column-list syntax should allow a list of columns to be assigned from a single row-valued expression, such as a sub-select: UPDATE accounts SET (contact_last_name, contact_first_name) =

[GENERAL] left join with smaller table or index on (XXX is not null) to avoid upsert

2009-01-18 Thread Ivan Sergio Borgonovo
I've to apply a discounts to products. For each promotion I've a query that select a list of products and should apply a discount. Queries may have intersections, in these intersections the highest discount should be applied. Since queries may be slow I decided to proxy the discount this way: c

Re: [GENERAL] invalid value for parameter "lc_messages": "en_US.ISO8859-1"

2009-01-18 Thread Tom Lane
"Abraham, Danny" writes: > Initdb fails on: creating template1 database in > /ema640/pgsql/data/base/1 ... FATAL: invalid value for parameter > "lc_messages": "en_US.ISO8859-1" Does "locale -a" list that as an installed locale? regards, tom lane -- Sent via pgsql-gener

[GENERAL] invalid value for parameter "lc_messages": "en_US.ISO8859-1"

2009-01-18 Thread Abraham, Danny
Hi, Details below: Initdb fails on: creating template1 database in /ema640/pgsql/data/base/1 ... FATAL: invalid value for parameter "lc_messages": "en_US.ISO8859-1" PG 8.2.4, AIX 5.3 German customer (I assume that it has some implications of locale). Can anyone help me in recreating the pro