pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: cees.van.zeeland@xs4all.nl
To: pgsql-bugs@postgresql.org
Subject: BUG #13168: DROP DATABASE does not clean up all references
Date: Sun, 26 Apr 2015 21:46:57 +0000
Message-ID: <20150426214657.2548.8172@wrigleys.postgresql.org> (raw)
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>

The following bug has been logged on the website:

Bug reference:      13168
Logged by:          Cees van Zeeland
Email address:      cees.van.zeeland@xs4all.nl
PostgreSQL version: 9.4.1
Operating system:   Windows 7 Home Edition 64 bit
Description:        

-- 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
  );

-- Now I am going to repeat the same script without DROP TABLE
-- After the next line, I assume that all old references within the database
are gone
DROP DATABASE new;

CREATE DATABASE new
  WITH ENCODING='LATIN1'
       TEMPLATE=template0
       LC_COLLATE='C'
       LC_CTYPE='C'
       CONNECTION LIMIT=-1;

-- Here I leave out the line with DROP TABLE 
-- It results to the error message:
-- ERROR: relation "category" already exists
-- Is this a bug or am I missing something?
-- 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
  );

DROP DATABASE new;

-- In fact I can repeat this script
-- first time: no error
-- second time: with error


-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs



view thread (3+ messages)  latest in thread

Message-ID: <20150426214657.2548.8172@wrigleys.postgresql.org>
Permalink:  ../20150426214657.2548.8172@wrigleys.postgresql.org/
Also on:    postgresql.org/message-id/20150426214657.2548.8172@wrigleys.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: cees.van.zeeland@xs4all.nl
  Subject: Re: BUG #13168: DROP DATABASE does not clean up all references
  In-Reply-To: <20150426214657.2548.8172@wrigleys.postgresql.org>
  References: <20150426214657.2548.8172@wrigleys.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox