Re: BUG #13168: DROP DATABASE does not clean up all references - Mailing list pgsql-bugs

From Tom Lane
Subject Re: BUG #13168: DROP DATABASE does not clean up all references
Date
Msg-id 1291.1430151801@sss.pgh.pa.us
Whole thread Raw
In response to BUG #13168: DROP DATABASE does not clean up all references  (cees.van.zeeland@xs4all.nl)
List pgsql-bugs
cees.van.zeeland@xs4all.nl writes:
> -- Follow the next steps to produce an unexpected error
> -- The next 16 lines work fine
> CREATE DATABASE new
>   WITH ENCODING='LATIN1'
>        TEMPLATE=template0
>        LC_COLLATE='C'
>        LC_CTYPE='C'
>        CONNECTION LIMIT=-1;

> DROP TABLE IF EXISTS category CASCADE;
> CREATE TABLE category
>   (
>      category_id SERIAL  PRIMARY KEY
>     ,category_name varchar(30) NOT NULL
>     ,category_description varchar(200) NOT NULL
>   );

AFAICS you didn't reconnect to database "new", so table "category" is
in whatever database you connected to originally.

> DROP DATABASE new;

If you had reconnected, it would not have allowed you to drop the current
database ...

            regards, tom lane

pgsql-bugs by date:

Previous
From: Marko Tiikkaja
Date:
Subject: Re: BUG #13160: Incorrect escaping of quotes in JSON export
Next
From: "David G. Johnston"
Date:
Subject: Re: BUG #13168: DROP DATABASE does not clean up all references