Re: Any reason not to return row_count in cursor of plpgsql?

From: Andrew Gierth <andrew(at)tao11(dot)riddles(dot)org(dot)uk>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: bruce(at)momjian(dot)us (Bruce Momjian), pgsql-hackers(at)postgresql(dot)org
Subject: Re: Any reason not to return row_count in cursor of plpgsql?
Date: 2009-03-27 20:59:29
Message-ID: 87hc1efzri.fsf@news-spur.riddles.org.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

>>>>> "Tom" == Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> writes:

> Andrew Gierth <andrew(at)tao11(dot)riddles(dot)org(dot)uk> writes:
>> GET DIAGNOSTICS ROW_COUNT is documented as working for all commands;
>> if it doesn't work for MOVE (and FETCH), that's a bug.

Tom> Or a documentation problem. I don't see any claim that it works for
Tom> "all commands" anyway.

"This command allows retrieval of system status indicators. Each item
is a key word identifying a state value to be assigned to the
specified variable (which should be of the right data type to receive
it). The currently available status items are ROW_COUNT, the number of
rows processed by the last SQL command sent down to the SQL engine,
and RESULT_OID, the OID of the last row inserted by the most recent
SQL command. Note that RESULT_OID is only useful after an INSERT
command into a table containing OIDs."

The idea that fetch/move should _intentionally_ not set ROW_COUNT is
beyond ludicrous.

--
Andrew.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message David Fetter 2009-03-27 21:05:44 Re: Any reason not to return row_count in cursor of plpgsql?
Previous Message Tom Lane 2009-03-27 20:49:45 Re: small but useful patches for text search