Port Bug Report: Dropping tables during transaction produces incorrect results - Mailing list pgsql-ports

From Unprivileged user
Subject Port Bug Report: Dropping tables during transaction produces incorrect results
Date
Msg-id 199901221445.JAA04593@hub.org
Whole thread Raw
List pgsql-ports
============================================================================
                        POSTGRESQL BUG REPORT TEMPLATE
============================================================================


Your name        : Basheer Dargham
Your email address    : dargham@essi.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
withinit don't. However, after an inserion into the table, not only the newly insterted table appears but also the ones
thatexisted 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
ifa drop is attempted within a transaction. That might be a solution. 

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


pgsql-ports by date:

Previous
From: Leszek Deska
Date:
Subject: New postgresql installation.
Next
From: James
Date:
Subject: install error Error 2