Re: Get diagnistic (row_count) 7.3 vs. 7.4 changes - Mailing list pgsql-general

From Richard Huxton
Subject Re: Get diagnistic (row_count) 7.3 vs. 7.4 changes
Date
Msg-id 41AEE1AD.9080606@archonet.com
Whole thread Raw
In response to Re: Get diagnistic (row_count) 7.3 vs. 7.4 changes  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
Tom Lane wrote:
> Maksim Likharev <MLikharev@micropat.com> writes:
>
>> in 7.3.3 GET DIAGNOSTICS was returning number of selected rows into
>> a temp table in 7.4.5 GET DIAGNOSTICS returns 0
>
>
> Hmm.  I'm not sure if that's a bug or an improvement.  The command
> did not return any rows to plpgsql, so in that sense row_count = 0 is
>  correct, but I can see why you feel you've lost some capability.
>
> Anyone else have an opinion about this?

Well, from the manuals:
"The currently available status items are ROW_COUNT, the number of rows
processed by the last SQL command sent down to the SQL engine"

Nothing there about rows being returned.

And by analogy:
"A PERFORM statement sets FOUND true if it produces (and discards) a
row, false if no row is produced."

If you've FOUND rows then presumably ROW_COUNT should be non-zero. So
set it if rows aren't returned I'd opine.

--
   Richard Huxton
   Archonet Ltd

pgsql-general by date:

Previous
From: Clodoaldo Pinto
Date:
Subject: ISO week and extract(dow from source)
Next
From: Clodoaldo Pinto
Date:
Subject: Re: Displaying more than six digits from a real number