Re: Bug in CREATE/DROP TABLESPACE command

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: William Garrison <postgres(at)mobydisk(dot)com>
Cc: pgsql-general(at)postgresql(dot)org, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Bug in CREATE/DROP TABLESPACE command
Date: 2007-03-22 17:50:42
Message-ID: 19197.1174585842@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers

William Garrison <postgres(at)mobydisk(dot)com> writes:
> Tom Lane wrote:
>> What do you mean by "one batch" exactly? Both CREATE and DROP TABLESPACE
>> refuse to run in a transaction block, so I'm confused about this.

> Not a transaction block. A batch of commands submitted to the server in
> a single call. In MSSQL land, I call that a batch. I don't know the
> PostgreSql term. If you are using the pgadmin3 GUI, then I mean pressing
> F5 once is a single batch. Pressing it twice is two batches.

Oh, it's a single simple-Query message. You could reproduce the problem
with psql if you put multiple commands into a "-c" command line switch.

This is a basic oversight in PreventTransactionChain: it doesn't reject
the case where the command is submitted as part of a multi-query string
in a single Query message.

This is relatively easy to fix in CVS HEAD --- we can just teach
exec_simple_query to pass isTopLevel = true only when the querystring
contains a single command, or maybe better only for the last command
of a querystring. I don't see any very practical way to fix it in
older releases though; at least not anything I'd want to backpatch
when it can't be tested first in HEAD. Anyone have an idea about a
reasonable back-branch fix?

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2007-03-22 18:01:09 Re: Deadlock with REINDEX TABLE
Previous Message Tom Lane 2007-03-22 16:47:35 Re: Bug in CREATE/DROP TABLESPACE command

Browse pgsql-hackers by date

  From Date Subject
Next Message Pavan Deolasee 2007-03-22 18:00:20 Re: CREATE INDEX and HOT - revised design
Previous Message Tom Lane 2007-03-22 17:41:26 Re: CREATE INDEX and HOT - revised design