============================================================================
POSTGRESQL BUG REPORT TEMPLATE
============================================================================
Your name : Zalman Stern
Your email address : zalman@netcom.com
Category : runtime: back-end: SQL
Severity : serious
Summary: Creating a table is not atomic.
System Configuration
--------------------
Operating System : Linux RedHat 5.2
PostgreSQL version : 6.5
Compiler used : gcc 2.7.2.3
Hardware:
---------
PostgreSQL 6.5.0 on i686-pc-linux-gnu, compiled by gcc 2.7.2.3
48 megs RAM
Versions of other tools:
------------------------
--------------------------------------------------------------------------
Problem Description:
--------------------
Creating a table within a transaction and then aborting the transaction leaves state around that makes it imposible to
createthe table later. Notably, there is a file with the name of the table in the database directory.
--------------------------------------------------------------------------
Test Case:
----------
On a newly created database, I run the following with corresponding output:
Command: psql -p9000 -c'begin ; create table foo ("name" text) ; abort; create table foo ("name" text);' testdb
Output: ERROR: Relation 'foo' already exists
Command: psql -p9000 -c'select * from foo;' testdb
Output: ERROR: foo: Table does not exist.
--------------------------------------------------------------------------
Solution:
---------
--------------------------------------------------------------------------