Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id 9522E632BF6 for ; Wed, 21 Jul 2010 09:41:30 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 23471-03 for ; Wed, 21 Jul 2010 12:41:22 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-ey0-f174.google.com (mail-ey0-f174.google.com [209.85.215.174]) by mail.postgresql.org (Postfix) with ESMTP id 2037563282E for ; Wed, 21 Jul 2010 09:41:22 -0300 (ADT) Received: by eya25 with SMTP id 25so1611379eya.19 for ; Wed, 21 Jul 2010 05:41:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:subject:date :user-agent:mime-version:content-type:message-id; bh=ioWTGIT3D3jkfhxe7kvCfFpsjpc8nJZiCp0dd8+zrho=; b=lEDa0EPMcgAqPfGEq+jxRWstba9htl9TON2YV9sCZyO968DE4Z1XOd2Wlmqd9yaVYo 4yluGE+YpaQQug1ir1as9B62l7bEAKlRRkCB6mPbFSU3bdMfWWd3cvT4nFyYgMZLLAJK 6uG5hy76ArDFVHDxyGutFmlntNFrTlFyTr3Fg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:subject:date:user-agent:mime-version:content-type :message-id; b=jS6wFAKTZEWZpFkpot0Z/QPF2sNnSI8HgrsmckRKGn3bqMNAT22cJg1Gjz7JJIQNc8 GtBa1CVDYPF0+OlXOTI8/XXg5crNBhH37xp0n1xtD+VMw5GMcAu6k4A+p7bBXx8ToZiJ s2H+FPZbdsX/hmzmBBbqtHyhD6S4/Ul9NBqQA= Received: by 10.213.19.207 with SMTP id c15mr6242387ebb.1.1279716080919; Wed, 21 Jul 2010 05:41:20 -0700 (PDT) Received: from marco-dalibo.localnet (gev44-1-78-228-108-65.fbx.proxad.net [78.228.108.65]) by mx.google.com with ESMTPS id a48sm53337698eei.7.2010.07.21.05.41.19 (version=SSLv3 cipher=RC4-MD5); Wed, 21 Jul 2010 05:41:19 -0700 (PDT) From: Marc Cousin To: pgsql-docs@postgresql.org Subject: error in oracle to plpgsql documentation ? Date: Wed, 21 Jul 2010 14:41:17 +0200 User-Agent: KMail/1.13.5 (Linux/2.6.34-ARCH; KDE/4.4.92; x86_64; ; ) MIME-Version: 1.0 Content-Type: Multipart/Mixed; boundary="Boundary-00=_truRMltLGxyKFxL" Message-Id: <201007211441.17678.cousinmarc@gmail.com> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.9 tagged_above=-5 required=5 tests=BAYES_00=-1.9 X-Spam-Level: X-Archive-Number: 201007/138 X-Sequence-Number: 5794 --Boundary-00=_truRMltLGxyKFxL Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit 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) --Boundary-00=_truRMltLGxyKFxL Content-Type: text/x-patch; charset="us-ascii"; name="patch_plpgsql_example" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="patch_plpgsql_example" 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 **** 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 ---- 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; --Boundary-00=_truRMltLGxyKFxL--