Skip site navigation (1) Skip section navigation (2)

Re: Documentation bug: Chapter 35.4, paragraph 4

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Jonathan Pool <pool(at)utilika(dot)org>
Cc: pgsql-bugs(at)postgresql(dot)org, Susan Colowick <smc(at)utilika(dot)org>
Subject: Re: Documentation bug: Chapter 35.4, paragraph 4
Date: 2010-11-28 13:05:12
Message-ID: AANLkTi=ieF0EjDD4E2X=_8DZcc82kwyobduC19u8f3pf@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-bugspgsql-docs
On Tue, Nov 23, 2010 at 1:08 PM, Jonathan Pool <pool(at)utilika(dot)org> 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 <enum> ADD
VALUE <label> (but the PreventTransactionChain call says ADD rather
than ADD VALUE), CREATE INDEX CONCURRENTLY, CREATE DATABASE, DROP
DATABASE, and REINDEX DATABASE.

I'm not sure if there's some generic way we could refer to all that
rather than listing them all individually.

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

In response to

Responses

pgsql-docs by date

Next:From: Thom BrownDate: 2010-11-28 23:59:55
Subject: Re: pgsql: Add index entries for more functions
Previous:From: Bruce MomjianDate: 2010-11-26 23:50:21
Subject: Re: [PATCH] Fix documentation about PL/Python exception handling

pgsql-bugs by date

Next:From: hubert depesz lubaczewskiDate: 2010-11-28 16:23:31
Subject: Re: BUG #5774: VACCUM & REINDEX kills production environement
Previous:From: Robert HaasDate: 2010-11-28 12:56:37
Subject: Re: BUG #5763: pg_hba.conf not honored

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group