Re: BUG #13168: DROP DATABASE does not clean up all references

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: cees(dot)van(dot)zeeland(at)xs4all(dot)nl
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #13168: DROP DATABASE does not clean up all references
Date: 2015-04-27 16:23:21
Message-ID: 1291.1430151801@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

cees(dot)van(dot)zeeland(at)xs4all(dot)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

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message David G. Johnston 2015-04-27 16:24:57 Re: BUG #13168: DROP DATABASE does not clean up all references
Previous Message Marko Tiikkaja 2015-04-27 16:12:48 Re: BUG #13160: Incorrect escaping of quotes in JSON export