Re: GET DIAGNOSTICS (was Re: Open 7.1 items)

From: Philip Warner <pjw(at)rhyme(dot)com(dot)au>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Peter Eisentraut <peter_e(at)gmx(dot)net>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: GET DIAGNOSTICS (was Re: Open 7.1 items)
Date: 2001-02-19 03:42:06
Message-ID: 3.0.5.32.20010219144206.02d936e0@mail.rhyme.com.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

At 20:40 18/02/01 -0500, Tom Lane wrote:
>Philip Warner <pjw(at)rhyme(dot)com(dot)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.

Probably a reasonably defensible position, too.

>> 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, ...;

Yes, but condition information (eg. SPI RESULT or SQLCODE), needs a
separate statement to row information (eg. ROW_COUNT). ie.

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

but it's not much of a problem, really. And I agree the 'x = y' syntax is
better.

Unfortunately, I don't have an awful lot of free time at the moment, so I
won't be able to look at this for at *least* as week.

----------------------------------------------------------------
Philip Warner | __---_____
Albatross Consulting Pty. Ltd. |----/ - \
(A.B.N. 75 008 659 498) | /(@) ______---_
Tel: (+61) 0500 83 82 81 | _________ \
Fax: (+61) 0500 83 82 82 | ___________ |
Http://www.rhyme.com.au | / \|
| --________--
PGP key available upon request, | /
and from pgp5.ai.mit.edu:11371 |/

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Fork 2001-02-19 04:23:48 Re: PHP 4.0.4pl1 / Beta 5
Previous Message Larry Rosenman 2001-02-19 03:24:58 Re: PHP 4.0.4pl1 / Beta 5