On 6/14/2011 8:08 PM, David Johnston wrote:
alter table tblissue add constraint
tblissue_parentissueid_fkey_casc_del FOREIGN KEY (parentissueid)
REFERENCES tblissue(issueid) ON DELETE CASCADE;
=
Then:
delete from tblissue where issueid=1;
DELETE 1
Hi,
I was surprised by the following behavior of Postgres (8.1).
Consider the following table and constraint:
=
CREATE TABLE tblissue(
issueid SERIAL PRIMARY KEY,
title TEXT,
comment TEXT,
createtimestamp TIMESTAMP DEFAULT (current_timestamp),
Erwin Moller erwinmol...@xs4all.nl writes:
Then:
delete from tblissue where issueid=1;
DELETE 1
Postgresql now deletes all rows that had a 1 for parentissueid. (5 in my
testcase).
That was correct, and as I intended, but why does Postgres answer
DELETE 1 instead of DELETE 6?
It's
On 6/14/2011 5:05 PM, Tom Lane wrote:
Erwin Mollererwinmol...@xs4all.nl writes:
Then:
delete from tblissue where issueid=1;
DELETE 1
Postgresql now deletes all rows that had a 1 for parentissueid. (5 in my
testcase).
That was correct, and as I intended, but why does Postgres answer
DELETE 1
alter table tblissue add constraint
tblissue_parentissueid_fkey_casc_del FOREIGN KEY (parentissueid)
REFERENCES tblissue(issueid) ON DELETE CASCADE;
=
Then:
delete from tblissue where issueid=1;
DELETE 1
Postgresql now deletes all rows that