Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1YmlPY-0006Gq-LH for pgsql-bugs@arkaria.postgresql.org; Mon, 27 Apr 2015 15:57:32 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1YmlPX-0005Za-La for pgsql-bugs@arkaria.postgresql.org; Mon, 27 Apr 2015 15:57:31 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1YmUOO-0002Ko-3a for pgsql-bugs@postgresql.org; Sun, 26 Apr 2015 21:47:12 +0000 Received: from wrigleys.postgresql.org ([204.145.124.246]) by magus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1YmUOG-0007bP-44 for pgsql-bugs@postgresql.org; Sun, 26 Apr 2015 21:47:11 +0000 MIME-Version: 1.0 Subject: BUG #13168: DROP DATABASE does not clean up all references To: pgsql-bugs@postgresql.org From: cees.van.zeeland@xs4all.nl Date: Sun, 26 Apr 2015 21:46:57 +0000 Message-ID: <20150426214657.2548.8172@wrigleys.postgresql.org> X-Pg-Spam-Score: -1.9 (-) Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org 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