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.
The following will submit this as one batch, and will NOT reproduce the
problem:
1) Open pgadmin3. Open the query tool. Paste in the following.
CREATE TABLESPACE bad_tablespace LOCATION E'C:\\postgresql\\MyDatabase';
DROP TABLESPACE IF EXISTS bad_tablespace;
CREATE TABLESPACE bad_tablespace LOCATION E'Z:\\postgresql\\MyDatabase';
DROP TABLESPACE IF EXISTS bad_tablespace;
2) Press F5
However, the following submits it in 3 batches, and will reproduce the
problem:
1) Open pgadmin3. Open the query tool. Paste in the following.
CREATE TABLESPACE bad_tablespace LOCATION E'C:\\postgresql\\MyDatabase';
2) Press F5
3) Delete the text, and replace it with the following:
DROP TABLESPACE IF EXISTS bad_tablespace;
CREATE TABLESPACE bad_tablespace LOCATION E'Z:\\postgresql\\MyDatabase';
4) Press F5
5) Delete the text, and replace it with the following:
DROP TABLESPACE IF EXISTS bad_tablespace;
6) Press F5
Strangely, I am unable to duplicate the problem with psql. I thought it
would submit a single batch if I didn't press enter between each
command, but it doesn't seem to work that way.
If there is a better term please let me know.
Tom Lane wrote:
> William Garrison <postgres@mobydisk.com> writes:
>> -- Drop the tablespace and re-create in in an invalid location
>> -- This only causes the bug if both these commands are run in one batch
>
> 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.
>
> regards, tom lane
>
> ---------------------------(end of broadcast)---------------------------
> TIP 3: Have you checked our extensive FAQ?
>
> http://www.postgresql.org/docs/faq
>