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

From Tom Lane
Subject Re: GET DIAGNOSTICS (was Re: Open 7.1 items)
Date
Msg-id 20723.982546810@sss.pgh.pa.us
Whole thread Raw
In response to Re: GET DIAGNOSTICS (was Re: Open 7.1 items)  (Philip Warner <pjw@rhyme.com.au>)
Responses Re: GET DIAGNOSTICS (was Re: Open 7.1 items)  (Jan Wieck <janwieck@Yahoo.com>)
List pgsql-hackers
Philip Warner <pjw@rhyme.com.au> writes:
>> 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?

> Sadly, we made it up.

Ah so.  Well, friendliness aside, I'd go with the spec's syntax.

> We *do* need to support ROW_COUNT, but allowing

>     GET DIAGNOSTICS Select ROW_COUNT, SQLCODE, OID Into :a,:b:,:c;

> is a lot friendlier than the standard:

>     GET DIAGNOSTICS :a = ROW_COUNT;
>     GET DIAGNOSTICS EXCEPTION 1 :b = SQLCODE;
>     GET DIAGNOSTICS :c = OID;

It looks to me like SQL99 allows
GET DIAGNOSTICS :a = ROW_COUNT, :b = OID, ...;

which is at least as good as the SELECT syntax, if not better since each
target variable and info spec are kept together.

> P.S. Is Jan around? He's been very quiet recently...

He's still engaged in moving from Germany to Norfolk, VA.  I think his
net-access is somewhat erratic :-(
        regards, tom lane


pgsql-hackers by date:

Previous
From: Philip Warner
Date:
Subject: Re: GET DIAGNOSTICS (was Re: Open 7.1 items)
Next
From: Tatsuo Ishii
Date:
Subject: Re: [SQL] PL/SQL-to-PL/PgSQL-HOWTO beta Available