Received: from localhost (maia-1.hub.org [200.46.204.191]) by postgresql.org (Postfix) with ESMTP id 64ED39FB73E for ; Sat, 17 Feb 2007 21:49:12 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.191]) (amavisd-new, port 10024) with ESMTP id 00840-02 for ; Sat, 17 Feb 2007 21:49:08 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from momjian.us (momjian.us [70.90.9.53]) by postgresql.org (Postfix) with ESMTP id 31D599FB43D for ; Sat, 17 Feb 2007 21:49:08 -0400 (AST) Received: (from bruce@localhost) by momjian.us (8.11.6/8.11.6) id l1I1lv207144; Sat, 17 Feb 2007 20:47:57 -0500 (EST) From: Bruce Momjian Message-Id: <200702180147.l1I1lv207144@momjian.us> Subject: Re: Odd PL/PgSQL Error -- relation "X" does not exist when using index expression In-Reply-To: <20070208155504.GA78152@winnie.fuhr.org> To: Michael Fuhr Date: Sat, 17 Feb 2007 20:47:57 -0500 (EST) CC: Tom Lane , Greg Wittel , pgsql-sql@postgresql.org X-Mailer: ELM [version 2.4ME+ PL123] MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="ELM1171763277-23234-0_" Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.056 tagged_above=0 required=5 tests=AWL, BAYES_50, SPF_HELO_PASS, SPF_PASS X-Spam-Level: X-Archive-Number: 200702/189 X-Sequence-Number: 27523 --ELM1171763277-23234-0_ Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="US-ASCII" Michael Fuhr wrote: > On Thu, Feb 08, 2007 at 10:32:25AM -0500, Tom Lane wrote: > > My advice is not to try to execute multiple commands in the same EXECUTE > > string --- if we were going to do anything to "fix" this, I think it > > would be along the lines of enforcing that advice. Trying to make the > > world safe for it doesn't sound productive. > > The SPI_execute() documentation does mention that multiple commands > are allowed: > > http://www.postgresql.org/docs/8.2/interactive/spi-spi-execute.html > > "You may pass multiple commands in one string. SPI_execute returns > the result for the command executed last. The count limit applies > to each command separately, but it is not applied to hidden commands > generated by rules. > > "When read_only is false, SPI_execute increments the command counter > and computes a new snapshot before executing each command in the > string." > > Should that documentation be modified? Done, and attached. -- Bruce Momjian http://momjian.us EnterpriseDB http://www.enterprisedb.com + If your life is a hard drive, Christ can be your backup. + --ELM1171763277-23234-0_ Content-Transfer-Encoding: 7bit Content-Type: text/x-diff Content-Disposition: inline; filename="/rtmp/diff" Index: doc/src/sgml/spi.sgml =================================================================== RCS file: /cvsroot/pgsql/doc/src/sgml/spi.sgml,v retrieving revision 1.52 diff -c -c -r1.52 spi.sgml *** doc/src/sgml/spi.sgml 1 Feb 2007 19:10:24 -0000 1.52 --- doc/src/sgml/spi.sgml 18 Feb 2007 01:45:45 -0000 *************** *** 321,327 **** ! You can pass multiple commands in one string. SPI_execute returns the result for the command executed last. The count limit applies to each command separately, but it is not applied to --- 321,328 ---- ! You can pass multiple commands in one string, but later commands cannot ! depend on the creation of objects earlier in the string. SPI_execute returns the result for the command executed last. The count limit applies to each command separately, but it is not applied to --ELM1171763277-23234-0_--