From: Marc Cousin <cousinmarc@gmail.com>
To: pgsql-docs@postgresql.org
Subject: error in oracle to plpgsql documentation ?
Date: Wed, 21 Jul 2010 14:41:17 +0200
Message-ID: <201007211441.17678.cousinmarc@gmail.com> (raw)
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)
Attachments:patch_plpgsql_example (text/x-patch, 772B) download
diff -r -c postgresql-orig/doc/src/sgml/plpgsql.sgml postgresql/doc/src/sgml/plpgsql.sgml
*** postgresql-orig/doc/src/sgml/plpgsql.sgml 2010-07-21 14:36:14.208439968 +0200
--- postgresql/doc/src/sgml/plpgsql.sgml 2010-07-21 14:37:13.921785739 +0200
***************
*** 4279,4285 ****
<programlisting>
CREATE OR REPLACE FUNCTION cs_update_referrer_type_proc() RETURNS void AS $func$
DECLARE
! CURSOR referrer_keys IS
SELECT * FROM cs_referrer_keys
ORDER BY try_order;
func_body text;
--- 4279,4285 ----
<programlisting>
CREATE OR REPLACE FUNCTION cs_update_referrer_type_proc() RETURNS void AS $func$
DECLARE
! referrer_keys CURSOR IS
SELECT * FROM cs_referrer_keys
ORDER BY try_order;
func_body text;
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-docs@postgresql.org
Cc: cousinmarc@gmail.com
Subject: Re: error in oracle to plpgsql documentation ?
In-Reply-To: <201007211441.17678.cousinmarc@gmail.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox