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

From Maksim Likharev
Subject Re: Get diagnistic (row_count) 7.3 vs. 7.4 changes
Date
Msg-id 000001c4d8f4$cfae8f40$8815a8c0@aurigin.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
On my opinion row_count should not be null due to the last operation
produced some records, copied to the temp table.

Basically it's irrelevant for me whether it fixed or not, I'll have to port
this code fast and going to use select count.

> -----Original Message-----
> From: Tom Lane [mailto:tgl@sss.pgh.pa.us]
> Sent: Wednesday, December 01, 2004 5:53 PM
> To: MLikharev@micropat.com
> Cc: pgsql-general@postgresql.org
> Subject: Re: [GENERAL] Get diagnistic (row_count) 7.3 vs. 7.4 changes
>
>
> 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: Michael Fuhr
Date:
Subject: Re: psql connection timeout
Next
From: "ON.KG"
Date:
Subject: Re: Select Database