Re: [SQL] Referential integrity broken (8.0.3), sub-select help

2006-03-22 Thread Patrick JACQUOT
[EMAIL PROTECTED] wrote: Hello, I've got 2 tables, url (U), and bookmark (B), with bookmark pointing to url via FK. Somehow I ended up with some rows in B referencing non-existent rows in U. This sounds super strange and dangerous to me, and it's not clear to me how/why PG let this happen.

Re: [SQL] Referential integrity broken (8.0.3), sub-select help

2006-03-21 Thread Aftab Alam
delete my email from the list Regards, -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of [EMAIL PROTECTED] Sent: Tuesday, March 21, 2006 8:29 PM To: pgsql-sql@postgresql.org Subject: [SQL] Referential integrity broken (8.0.3), sub-select help Hello

Re: [SQL] Referential integrity broken (8.0.3), sub-select help

2006-03-21 Thread Stephan Szabo
On Tue, 21 Mar 2006 [EMAIL PROTECTED] wrote: I've got 2 tables, url (U), and bookmark (B), with bookmark pointing to url via FK. That's not what your schema below has. Your fragment below has URL pointing to bookmark. Somehow I ended up with some rows in B referencing non-existent rows in

[SQL] Referential integrity broken (8.0.3), sub-select help

2006-03-21 Thread ogjunk-pgjedan
Hello, I've got 2 tables, url (U), and bookmark (B), with bookmark pointing to url via FK. Somehow I ended up with some rows in B referencing non-existent rows in U. This sounds super strange and dangerous to me, and it's not clear to me how/why PG let this happen. I'm using 8.0.3. Here are

Re: [SQL] Referential integrity broken (8.0.3), sub-select help

2006-03-21 Thread ogjunk-pgjedan
] Referential integrity broken (8.0.3), sub-select help On Tue, 21 Mar 2006 [EMAIL PROTECTED] wrote: I've got 2 tables, url (U), and bookmark (B), with bookmark pointing to url via FK. That's not what your schema below has. Your fragment below has URL pointing to bookmark. Somehow I ended up

Re: [SQL] Referential integrity broken (8.0.3), sub-select help

2006-03-21 Thread Stephan Szabo
On Tue, 21 Mar 2006 [EMAIL PROTECTED] wrote: I mistakenly swapped the tables in my email. Here they are, corrected: Table url: id SERIAL CONSTRAINT pk_url_id PRIMARY KEY Table bookmark: url_id INTEGER

Re: [SQL] Referential integrity broken (8.0.3), sub-select help

2006-03-21 Thread Scott Marlowe
On Tue, 2006-03-21 at 08:58, [EMAIL PROTECTED] wrote: Hello, I've got 2 tables, url (U), and bookmark (B), with bookmark pointing to url via FK. Somehow I ended up with some rows in B referencing non-existent rows in U. This sounds super strange and dangerous to me, and it's not clear to