GET DIAGNOSTICS (was Re: Open 7.1 items) - Mailing list pgsql-hackers

From Tom Lane
Subject GET DIAGNOSTICS (was Re: Open 7.1 items)
Date
Msg-id 20424.982540162@sss.pgh.pa.us
Whole thread Raw
In response to Re: Open 7.1 items  (Peter Eisentraut <peter_e@gmx.net>)
Responses Re: GET DIAGNOSTICS (was Re: Open 7.1 items)  (Philip Warner <pjw@rhyme.com.au>)
Re: GET DIAGNOSTICS (was Re: Open 7.1 items)  (Jan Wieck <janwieck@Yahoo.com>)
List pgsql-hackers
Peter Eisentraut <peter_e@gmx.net> writes:
> Quoting a recent message by Jan Wieck <janwieck@Yahoo.com>:
> :Do a
> :
> :    GET DIAGNOSTICS SELECT PROCESSED INTO <int4_variable>;
> :
> :directly  after  an  INSERT,  UPDATE  or DELETE statement and you'll know
> :how many rows have been hit.
> :
> :Also you can get the OID of an inserted row with
> :
> :    GET DIAGNOSTICS SELECT RESULT INTO <int4_variable>;

> May I suggest that this is the wrong syntax?  It should be
>
> GET DIAGNOSTICS <variable> = ROW_COUNT;
>
> See SQL99 part 2, clause 19.1.

Hmm, that's definitely what SQL99 uses for the syntax.  I wonder where
Jan got the SELECT INTO syntax --- did he borrow it from Oracle?
Anyone have an Oracle manual to check?

I'd be more inclined to follow the spec than Oracle, anyway.  But
if we're going to change it, we'd better do so before 7.1 release,
else we'll have a backwards-compatibility problem.

We'd need to come up with a name for the inserted-OID result,
since that's not one of the spec-listed items.  I'd suggest justGET DIAGNOSTICS <variable> = OID;
which seems unlikely to conflict with any future spec extension.
But maybe someone has a better idea.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Larry Rosenman
Date:
Subject: Re: (forw) (forw) Re: PHP 4.0.4pl1 BUILD: BUSTED WITH CURRENT CVS
Next
From: "Mitch Vincent"
Date:
Subject: PHP 4.0.4pl1 / Beta 5