Thread: error in oracle to plpgsql documentation ?

error in oracle to plpgsql documentation ?

From
Marc Cousin
Date:
Hi,

A user had a syntax problem with a cursor declaration. After a bit of digging,
the code he used came directly from the documentation :

DECLARE
    CURSOR referrer_keys IS
        SELECT * FROM cs_referrer_keys
        ORDER BY try_order;
    func_body text;
    func_cmd text;

I guess it should be

DECLARE
    referrer_keys CURSOR IS
        SELECT * FROM cs_referrer_keys
        ORDER BY try_order;
    func_body text;
    func_cmd text;

(syntax is inverted in Oracle, so I guess it is a typo ?)

If I'm right, a patch is attached (the code works with the correction)



Attachment

Re: error in oracle to plpgsql documentation ?

From
"Kevin Grittner"
Date:
Marc Cousin <cousinmarc@gmail.com> wrote:

> DECLARE
>     CURSOR referrer_keys IS

> I guess it should be
>
> DECLARE
>     referrer_keys CURSOR IS

> If I'm right, a patch is attached (the code works with the
> correction)

The patch looks correct to me.

-Kevin

Re: error in oracle to plpgsql documentation ?

From
Robert Haas
Date:
On Wed, Jul 21, 2010 at 1:07 PM, Kevin Grittner
<Kevin.Grittner@wicourts.gov> wrote:
> Marc Cousin <cousinmarc@gmail.com> wrote:
>
>> DECLARE
>>     CURSOR referrer_keys IS
>
>> I guess it should be
>>
>> DECLARE
>>     referrer_keys CURSOR IS
>
>> If I'm right, a patch is attached (the code works with the
>> correction)
>
> The patch looks correct to me.

Committed.  I back-patched this as far as 8.4 so that the web site
docs will get updated, but it didn't seem important enough to go back
further.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise Postgres Company