Re: psql reports back wrong number of affected rows.

From: "erwin(at)darwine(dot)nl" <erwin(at)darwine(dot)nl>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: psql reports back wrong number of affected rows.
Date: 2011-06-14 15:30:28
Message-ID: 4DF77E94.8050309@darwine.nl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 6/14/2011 5:05 PM, Tom Lane wrote:
> Erwin Moller<erwinmoller(at)xs4all(dot)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 reporting the number of rows deleted from tblissue.

Hi,

But I deleted 6 from tblissue in my example.
(1 directly, the other 5 by cascade)
Hence my confusion.

> Cascade
> effects are not relevant.
>

Ok, clear.
So the number of deleted rows (DELETE x) are only the ones that directly
matched the ones in the where-clause.

I suspected that much, but it is better to check. :-)

Thanks for your time, Tom

Regards,
Erwin Moller

> regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2011-06-14 15:51:59 Re: Executing \i of psql command using libpq library
Previous Message Mark Morgan Lloyd 2011-06-14 15:23:15 Re: Per-query local timezone