Re: Queries using rules show no rows modified?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Jan Wieck <janwieck(at)yahoo(dot)com>
Cc: Hiroshi Inoue <Inoue(at)tpf(dot)co(dot)jp>, Michael Alan Dorman <mdorman(at)debian(dot)org>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Queries using rules show no rows modified?
Date: 2002-05-10 14:57:33
Message-ID: 28286.1021042653@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Jan Wieck <janwieck(at)yahoo(dot)com> writes:
> IMHO the answer should only be a number if the rewritten
> querytree list consists of one query of the same command
> type. everything else has to lead into "unknown".

I think you can easily generalize that to the statement that the
result should be the sum of the rewritten operations of the same
type as the original query; requiring there to be exactly one
seems overly restrictive.

Michael seems to feel that the tuple count should be nonzero if any
of the replacement operations did anything at all. This does not make
a lot of sense at the command tag level ("UPDATE 4" might not mean
that 4 tuples were updated) but if you look at the definition of
PQcmdTuples ("returns the number of rows affected by the SQL command")
it's not so unreasonable. And I can see the point of wanting to
know whether anything happened.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2002-05-10 15:03:54 Re: Queries using rules show no rows modified?
Previous Message Jean-Michel POURE 2002-05-10 14:51:14 Re: pgAdmin2 to be included in Dev-C++