Re: CREATE DATABASE cannot be executed from a function or multi-command string

From: Dave Page <dpage(at)postgresql(dot)org>
To: Andrew Dunstan <andrew(at)dunslane(dot)net>
Cc: Heikki Linnakangas <heikki(at)enterprisedb(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: CREATE DATABASE cannot be executed from a function or multi-command string
Date: 2007-09-24 13:18:38
Message-ID: 46F7B92E.9040004@postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Andrew Dunstan wrote:
>
> src/bin/psql/common.c has a routine that lets psql get round this, by
> not sending a BEGIN in the case of the offending statements. I have no
> idea if this might be helpful for pgadmin though.

Yeah, unfortunately it's not that we wrap the statement in a begin/end -
we rely on the fact that each call to PQexec is implicitly a single
transaction.

We're aware of course that CREATE DATABASE can't run in a transaction
block but just turned a blind eye to that on the grounds that it was
much more likely to fail than any of the other statements following it
in the multi-statement and we weren't about to start rolling it back
ourselves anyway.

Thanks, Dave.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Gregory Stark 2007-09-24 14:15:01 Re: [PATCHES] Eliminate more detoast copies for packed varlenas
Previous Message Thea 2007-09-24 13:10:49 Re: LIKE wildcards escaping problem