Re: [GENERAL] psql reports back wrong number of affected rows.

2011-06-17 Thread Erwin Moller
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 P

Re: [GENERAL] psql reports back wrong number of affected rows.

2011-06-14 Thread David Johnston
> 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

Re: [GENERAL] psql reports back wrong number of affected rows.

2011-06-14 Thread er...@darwine.nl
On 6/14/2011 5:05 PM, Tom Lane wrote: Erwin Moller 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?

Re: [GENERAL] psql reports back wrong number of affected rows.

2011-06-14 Thread Tom Lane
Erwin Moller 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 reporting the numbe

[GENERAL] psql reports back wrong number of affected rows.

2011-06-14 Thread Erwin Moller
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), par