[SQL] Foreign key - Indexing & Deadlocking.

2009-12-29 Thread Andrew Hall
Hi, I'm porting some Oracle software to PostgreSQL, & have a question about best practices with foreign keys. In the Oracle environment, you're basically obliged to index all foreign keys (more specifically foreign key columns should appear on the leading edge of an index) due to the way that

Re: [SQL] Using || operator to fold multiple columns into one

2009-12-29 Thread Bryce Nesbitt
Craig Ringer wrote: On 24/12/2009 5:04 AM, Rosser Schwarz wrote: On Wed, Dec 23, 2009 at 1:44 AM, Craig Ringer wrote: Your invocation of COALESCE is incorrect -- it is n-ary, but it returns its first non-NULL argument. Yes. That was the point. I think we're assuming the OP wants different th

Re: [SQL] Foreign key - Indexing & Deadlocking.

2009-12-29 Thread Craig Ringer
On 30/12/2009 6:59 AM, Andrew Hall wrote: Hi, I'm porting some Oracle software to PostgreSQL, & have a question about best practices with foreign keys. In the Oracle environment, you're basically obliged to index all foreign keys (more specifically foreign key columns should appear on the leadi

Re: [SQL] [GENERAL] DataBase Problem

2009-12-29 Thread Craig Ringer
On 30/12/2009 9:49 AM, Premila Devi wrote: Caused by: _java.sql.SQLException_: Couldn't perform the operation rollback: You can't perform any operations on this connection. It has been automatically closed by Proxool for some reason (see logs). "see logs" Look at your proxool logs and see why