Received: from localhost (maia-5.hub.org [200.46.204.182]) by postgresql.org (Postfix) with ESMTP id 59C7B9FB289 for ; Thu, 8 Feb 2007 11:59:22 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.182]) (amavisd-new, port 10024) with ESMTP id 41381-03 for ; Thu, 8 Feb 2007 11:59:18 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by postgresql.org (Postfix) with ESMTP id B4BAF9FB25E for ; Thu, 8 Feb 2007 11:59:18 -0400 (AST) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.13.6/8.13.6) with ESMTP id l18FxGOc008488; Thu, 8 Feb 2007 10:59:16 -0500 (EST) To: Michael Fuhr cc: Greg Wittel , pgsql-sql@postgresql.org Subject: Re: Odd PL/PgSQL Error -- relation "X" does not exist when using index expression In-reply-to: <20070208155504.GA78152@winnie.fuhr.org> References: <45CA5601.1090007@proofpoint.com> <20070208112331.GA75899@winnie.fuhr.org> <20070208141433.GD24069@alvh.no-ip.org> <20070208150746.GA77230@winnie.fuhr.org> <8064.1170948745@sss.pgh.pa.us> <20070208155504.GA78152@winnie.fuhr.org> Comments: In-reply-to Michael Fuhr message dated "Thu, 08 Feb 2007 08:55:04 -0700" Date: Thu, 08 Feb 2007 10:59:16 -0500 Message-ID: <8487.1170950356@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200702/91 X-Sequence-Number: 27425 Michael Fuhr writes: > 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: Well, the point here is that there's one pass of parsing and one of execution, and you won't get far if the parsing pass requires an earlier command to have already been executed. So maybe the appropriate warning is something about not using interdependent DDL commands. Feel free to draft up a docs patch. regards, tom lane