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

From Tom Lane
Subject Re: Get diagnistic (row_count) 7.3 vs. 7.4 changes
Date
Msg-id 29003.1101952397@sss.pgh.pa.us
Whole thread Raw
In response to Get diagnistic (row_count) 7.3 vs. 7.4 changes  (Maksim Likharev <MLikharev@micropat.com>)
Responses Re: Get diagnistic (row_count) 7.3 vs. 7.4 changes  (Richard Huxton <dev@archonet.com>)
Re: Get diagnistic (row_count) 7.3 vs. 7.4 changes  (Maksim Likharev <MLikharev@micropat.com>)
List pgsql-general
Maksim Likharev <MLikharev@micropat.com> writes:
> consider following code:

> CREATE OR REPLACE FUNCTION rowcount_test() RETURNS bigint AS '
> DECLARE
>     base_hits bigint;
> BEGIN
>     CREATE TEMP TABLE ltbl_temp AS SELECT 1 AS data;
>     GET DIAGNOSTICS base_hits = ROW_COUNT;

>     RETURN base_hits;
> END;
> ' LANGUAGE PLPGSQL VOLATILE;

> 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?

            regards, tom lane

pgsql-general by date:

Previous
From: Bill Kurland
Date:
Subject: md5 checksum mismatch
Next
From: Clodoaldo Pinto
Date:
Subject: Displaying more than six digits from a real number