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

Port Bug Report: Dropping tables during transaction produces incorrect results

From: Unprivileged user <nobody>
To: pgsql-ports(at)postgresql(dot)org
Subject: Port Bug Report: Dropping tables during transaction produces incorrect results
Date: 1999-01-22 14:45:14
Message-ID: 199901221445.JAA04593@hub.org (view raw or flat)
Thread:
Lists: pgsql-ports
============================================================================
                        POSTGRESQL BUG REPORT TEMPLATE
============================================================================


Your name		: Basheer Dargham
Your email address	: dargham(at)essi(dot)fr

Category		: runtime: back-end: SQL
Severity		: non-critical

Summary: Dropping tables during transaction produces incorrect results

System Configuration
--------------------
  Operating System   : RedHat Linux 5.2

  PostgreSQL version : 6.4.2

  Compiler used      : gcc 2.7.2.3

Hardware:
---------
Pentium 64M RAM
Linux xxx.essi.fr 2.0.36 #1 Tue Oct 13 22:17:11 EDT 1998 i686 unknown


Versions of other tools:
------------------------
gmake (GNU Make 3.76.1)
flex version 2.5.4 

--------------------------------------------------------------------------

Problem Description:
--------------------
If a table is dropped during a transaction, and then the transaction is aborted, the table returns but the tuples within it don't. However, after an inserion into the table, not only the newly insterted table appears but also the ones that existed prior to the drop.

--------------------------------------------------------------------------

Test Case:
----------
root=> create table foo
root-> (id integer,
root-> nom varchar);
CREATE
root=> insert into foo values (1,'Bonjour');
INSERT 18794 1
root=> insert into foo values (2,'Hello');
INSERT 18795 1
root=> insert into foo values (3,'Ciao');
INSERT 18796 1
root=> select * from foo;
id|nom
--+-------
 1|Bonjour
 2|Hello
 3|Ciao
(3 rows)

root=> begin;
BEGIN
root=> drop table foo;
DROP
root=> select * from foo;
ERROR:  foo: Table does not exist.
root=> rollback;
ABORT
root=> select * from foo;
id|nom
--+---
(0 rows)

root=> select * from foo;
id|nom
--+---
(0 rows)
root=> insert into foo values (4,'Guten tag');
INSERT 18816 1
root=> select * from foo;
id|nom
--+---------
 1|Bonjour
 2|Hello
 3|Ciao
 4|Guten tag
(4 rows)

root=> \q


--------------------------------------------------------------------------

Solution:
---------
I'm not too sure but dropping a table during a transaciton doesn't make much sense. Sybase ASE simply throws an error if a drop is attempted within a transaction. That might be a solution.

--------------------------------------------------------------------------


pgsql-ports by date

Next:From: JamesDate: 1999-01-24 15:31:08
Subject: install error Error 2
Previous:From: Leszek DeskaDate: 1999-01-22 10:21:54
Subject: New postgresql installation.

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group