[GENERAL] Which record causes referential integrity violation on delete

2005-07-02 Thread Andrus
In Postgres 8 I tried commad DELETE FROM customer WHERE id=123 but got an error ERROR: update or delete on "customer" violates foreign key constraint "invoice_customer_fkey" on "invoice"' How to determine the primary key of invoice table which causes this error in generic way ? Why Postgres

Re: [GENERAL] Which record causes referential integrity violation on delete

2005-07-02 Thread Tom Lane
"Andrus" <[EMAIL PROTECTED]> writes: > ERROR: update or delete on "customer" violates foreign key constraint > "invoice_customer_fkey" on "invoice"' > How to determine the primary key of invoice table which causes this error > in generic way ? There is no generic way to do that, because the que

Re: [GENERAL] Which record causes referential integrity violation on delete

2005-07-02 Thread Dawid Kuroczko
On 7/1/05, Andrus <[EMAIL PROTECTED]> wrote: > In Postgres 8 I tried commad > > DELETE FROM customer WHERE id=123 > > but got an error > > ERROR: update or delete on "customer" violates foreign key constraint > "invoice_customer_fkey" on "invoice"' > > How to determine the primary key of invoi

Re: [GENERAL] Which record causes referential integrity violation on delete

2005-07-02 Thread Dawid Kuroczko
On 7/2/05, Dawid Kuroczko <[EMAIL PROTECTED]> wrote: > On 7/1/05, Andrus <[EMAIL PROTECTED]> wrote: > > In Postgres 8 I tried commad > > > > DELETE FROM customer WHERE id=123 > > > > but got an error > > > > ERROR: update or delete on "customer" violates foreign key constraint > > "invoice_custome

Re: [GENERAL] Which record causes referential integrity violation on delete

2005-07-02 Thread Martin Boese
On Friday 01 July 2005 19:49, you wrote: > In Postgres 8 I tried commad > > DELETE FROM customer WHERE id=123 (snip) > ---(end of broadcast)--- > TIP 8: explain analyze is your friend Automatically answered?! :-) explain analyze DELETE FROM custo

Re: [GENERAL] Which record causes referential integrity violation on delete

2005-07-03 Thread Andrus Moor
> On Friday 01 July 2005 19:49, you wrote: >> In Postgres 8 I tried commad >> >> DELETE FROM customer WHERE id=123 > > (snip) > >> ---(end of broadcast)--- >> TIP 8: explain analyze is your friend > > > Automatically answered?! :-) > > explain analyze

Re: [GENERAL] Which record causes referential integrity violation on delete

2005-07-03 Thread Andrus Moor
> I forgot to add, this is of course a "simplistic" approach which: > 1. may be simply wrong > 2. assumes data is available to user in nformation_schema (I guess the > information schema lists only data owned by user; yet I am not sure > about that). > 3. assumes foreign keys have really simple set

Re: [GENERAL] Which record causes referential integrity violation on delete

2005-07-10 Thread Greg Sabino Mullane
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 "Andrus" wrote: > DELETE FROM customer WHERE id=123 > > but got an error > > ERROR: update or delete on "customer" violates foreign key constraint > "invoice_customer_fkey" on "invoice"' > How to determine the primary key of invoice table which ca