Re: Get diagnistic (row_count) 7.3 vs. 7.4 changes

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: MLikharev(at)micropat(dot)com
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Get diagnistic (row_count) 7.3 vs. 7.4 changes
Date: 2004-12-02 01:53:17
Message-ID: 29003.1101952397@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Maksim Likharev <MLikharev(at)micropat(dot)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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Eric E 2004-12-02 02:34:28 Pl/Perl w/ Postgres 8.0 on Windows
Previous Message Bill Kurland 2004-12-02 00:01:24 md5 checksum mismatch