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  <[EMAIL PROTECTED]>          http://momjian.us
  EnterpriseDB                               http://www.enterprisedb.com

  + If your life is a hard drive, Christ can be your backup. +
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 ****
    </para>
  
    <para>
!    You can pass multiple commands in one string.
     <function>SPI_execute</function> returns the
     result for the command executed last.  The <parameter>count</parameter>
     limit applies to each command separately, but it is not applied to
--- 321,328 ----
    </para>
  
    <para>
!    You can pass multiple commands in one string, but later commands cannot
!    depend on the creation of objects earlier in the string.
     <function>SPI_execute</function> returns the
     result for the command executed last.  The <parameter>count</parameter>
     limit applies to each command separately, but it is not applied to
---------------------------(end of broadcast)---------------------------
TIP 3: Have you checked our extensive FAQ?

               http://www.postgresql.org/docs/faq

Reply via email to