Problems with GET DIAGNOSTICS SELECT PROCESSED INTO result;

From: "Dr(dot) Evil" <drevil(at)sidereal(dot)kz>
To: pgsql-general(at)postgresql(dot)org
Subject: Problems with GET DIAGNOSTICS SELECT PROCESSED INTO result;
Date: 2001-09-06 20:43:56
Message-ID: 20010906204356.11975.qmail@sidereal.kz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


It doesn't seem to work as advertised:

DROP TABLE junk;
CREATE TABLE junk (something INT4);

DROP FUNCTION testfunction(INT4);
CREATE FUNCTION testfunction(INT4) RETURNS INT4 AS '
DECLARE
result INT4;
BEGIN
INSERT INTO junk (something) VALUES ($1);
GET DIAGNOSTICS SELECT PROCESSED INTO result;
RETURN result;
END;
' LANGUAGE 'plpgsql';

When I then run it I get:

=> select testfunction(10);
NOTICE: plpgsql: ERROR during compile of testfunction near line 5
ERROR: parse error at or near "SELECT"

Any idea how to get this to work? This is with PG7.1.2.

Thanks

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Bruce Momjian 2001-09-06 20:51:31 Re: [ANNOUNCE] OSDN Announces Open Source Database Summit, September
Previous Message Oliver Elphick 2001-09-06 20:37:02 Re: Bug in createlang?