Thread: Port Bug Report: "drop database DBNAME;" command has critical bug!!!

Port Bug Report: "drop database DBNAME;" command has critical bug!!!

From
Unprivileged user
Date:
============================================================================
                        POSTGRESQL BUG REPORT TEMPLATE
============================================================================


Your name               : KiBaek Jeong
Your email address      : hannoory@chollian.net

Category                : runtime: back-end
Severity                : critical

Summary: "drop database DBNAME;" command has critical bug!!!

System Configuration
--------------------
  Operating System   : Solaris 2.5.1

  PostgreSQL version : 6.4.2

  Compiler used      : gcc 2.8.1

Hardware:
---------
SunOS main 5.5.1 Generic_103640-12 sun4u sparc SUNW,Ultra-1

Versions of other tools:
------------------------
GNU Make version 3.77
flex version 2.5.4

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

Problem Description:
--------------------
0. psql template1
1. create database hahaha;
2. \c hahaha
3. create table xxx (i int, c char(30), content text);
4. \c template1
5. DROP DATABASE hahaha;
THEN...
6. CREATE DATABASE hahaha;
And THEN, I hope "hahaha" database don't have any tables.
But type \d then, newly "hahaha" database has
previous "xxx" table!!!!!
It's critical error to me.
At this period, if I try to delete this strange xxx table,
then backend prints "ERROR1" -> Message is
"ERROR:  cannot find attribute 1 of relation xxx"
For solving the problem... I must kill my postmaster server.
Then error is cleared.(xxx table is cleared)
But there is still this entire problems... Please help me.


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

Test Case:
----------
0. psql template1
1. create database hahaha;
2. \c hahaha
3. create table xxx (i int, c char(30), content text);
4. \c template1
5. DROP DATABASE hahaha;
THEN...
6. CREATE DATABASE hahaha;
7. \c hahaha
8. \d
   EXIST!, xxx table!!! it's error!
9. select * from xxx;
   THEN, ERROR:  cannot find attribute 1 of relation xxx


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

Solution:
---------


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


> Summary: "drop database DBNAME;" command has critical bug!!!

Seems to not be a problem in the current sources:

hahaha=> \c postgres
connecting to new database: postgres
postgres=> drop database hahaha;
DESTROYDB
postgres=> create database hahaha;
CREATEDB
postgres=> \c hahaha
connecting to new database: hahaha
hahaha=> \d
Couldn't find any tables, sequences or indices!

                      - Thomas

--
Thomas Lockhart                lockhart@alumni.caltech.edu
South Pasadena, California

> > Summary: "drop database DBNAME;" command has critical bug!!!
>
> Seems to not be a problem in the current sources:
>
> hahaha=> \c postgres
> connecting to new database: postgres
> postgres=> drop database hahaha;
> DESTROYDB
> postgres=> create database hahaha;
> CREATEDB
> postgres=> \c hahaha
> connecting to new database: hahaha
> hahaha=> \d
> Couldn't find any tables, sequences or indices!

6.4 did not flush buffers on database close, so this may have been the
source of the problem.  6.5 is OK.

--
  Bruce Momjian                        |  http://www.op.net/~candle
  maillist@candle.pha.pa.us            |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026