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

Peripheral Links

Header And Logo

PostgreSQL
| The world's most advanced open source database.

Site Navigation

Search for
  Advanced Search

Re: Bug in CREATE/DROP TABLESPACE command


  • From: William Garrison <postgres(at)mobydisk(dot)com>
  • To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
  • Cc: pgsql-general(at)postgresql(dot)org
  • Subject: Re: Bug in CREATE/DROP TABLESPACE command
  • Date: Thu, 22 Mar 2007 13:40:03 -0500
  • Message-id: <4602CD83(dot)2090801(at)mobydisk(dot)com>

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(at)mobydisk(dot)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





Home | Main Index | Thread Index

Privacy Policy | PostgreSQL Archives hosted by Command Prompt, Inc. | Designed by tinysofa
Copyright © 1996 – 2008 PostgreSQL Global Development Group