Re: [GENERAL] Bug in CREATE/DROP TABLESPACE command - Mailing list pgsql-hackers

From Tom Lane
Subject Re: [GENERAL] Bug in CREATE/DROP TABLESPACE command
Date
Msg-id 19197.1174585842@sss.pgh.pa.us
Whole thread Raw
List pgsql-hackers
William Garrison <postgres@mobydisk.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

pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: CREATE INDEX and HOT - revised design
Next
From: "Pavan Deolasee"
Date:
Subject: Re: CREATE INDEX and HOT - revised design