Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id 331F51337BD5 for ; Thu, 10 Mar 2011 19:51:07 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.29]) (amavisd-maia, port 10024) with ESMTP id 80240-01 for ; Thu, 10 Mar 2011 23:50:58 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from momjian.us (momjian.us [70.90.9.53]) by mail.postgresql.org (Postfix) with ESMTP id 4E9D21337BBA for ; Thu, 10 Mar 2011 19:50:56 -0400 (AST) Received: (from bruce@localhost) by momjian.us (8.11.6/8.11.6) id p2ANouw26781; Thu, 10 Mar 2011 18:50:56 -0500 (EST) From: Bruce Momjian Message-Id: <201103102350.p2ANouw26781@momjian.us> Subject: Re: Documentation bug: Chapter 35.4, paragraph 4 In-Reply-To: To: Robert Haas Date: Thu, 10 Mar 2011 18:50:56 -0500 (EST) CC: Jonathan Pool , pgsql-bugs@postgresql.org, Susan Colowick X-Mailer: ELM [version 2.4ME+ PL124 (25)] MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="ELM1299801056-14502-0_" Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.91 tagged_above=-5 required=5 tests=BAYES_00=-1.9, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201103/181 X-Sequence-Number: 29691 --ELM1299801056-14502-0_ Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="US-ASCII" Robert Haas wrote: > On Tue, Nov 23, 2010 at 1:08 PM, Jonathan Pool wrote: > > Chapter 35.4, paragraph 4, of the PostgreSQL 9.0.1 Documentation says: > > > > Any collection of commands in the SQL language can be packaged together and defined as a function. Besides SELECT queries, the commands can include data modification queries (INSERT, UPDATE, and DELETE), as well as other SQL commands. (The only exception is that you cannot put BEGIN, COMMIT, ROLLBACK, or SAVEPOINT commands into a SQL function.) > > > > This appears to be incorrect, in that attempting to include a VACUUM command in a query-language function elicits the following error message: > > > > ERROR: ?VACUUM cannot be executed from a function or multi-command string > > > > Thus, presumably "VACUUM" should be added to the list of exceptions. > > I fear it's worse than that. Taking a look at the places where we > call PreventTransactionChain(), they appear to include database-wide > CLUSTER, DISCARD ALL, VACUUM (as you noted), COMMIT PREPARED, ROLLBACK > PREPARED, CREATE TABLESPACE, DROP TABLESPACE, ALTER TYPE ADD > VALUE