Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gzW1n-0004NZ-Cd for pgsql-general@arkaria.postgresql.org; Fri, 01 Mar 2019 00:27:51 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gzW1l-0005bZ-U3 for pgsql-general@arkaria.postgresql.org; Fri, 01 Mar 2019 00:27:49 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gzVyt-00056R-IW for pgsql-general@lists.postgresql.org; Fri, 01 Mar 2019 00:24:51 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gzVyq-0000kD-T7 for pgsql-general@lists.postgresql.org; Fri, 01 Mar 2019 00:24:50 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id x210Ok2d004100; Thu, 28 Feb 2019 19:24:46 -0500 From: Tom Lane To: s400t@yahoo.co.jp cc: "pgsql-general@lists.postgresql.org" Subject: Re: Mind of its own? In-reply-to: <620929187.763288.1551399043803.JavaMail.yahoo@mail.yahoo.co.jp> References: <620929187.763288.1551399043803.JavaMail.yahoo.ref@mail.yahoo.co.jp> <620929187.763288.1551399043803.JavaMail.yahoo@mail.yahoo.co.jp> Comments: In-reply-to message dated "Fri, 01 Mar 2019 09:10:43 +0900" MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-ID: <4098.1551399886.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Thu, 28 Feb 2019 19:24:46 -0500 Message-ID: <4099.1551399886@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk writes: > I am using Postgresql 9.6, and the latest phppgadmin. OS is Debian 9.6. > 1. Created a database. > 2. Created tables inside that database. > 3. Dropped that database. > Now, what happens is when I create another database with the same name o= r different name, all those tables are already inside that database!!! I h= ave not run the table create script.=C2=A0 I think you created some tables in the "template1" database, which is (by default) what CREATE DATABASE clones to make a new DB. Duplicating its contents is considered a feature not a bug. You could manually clean out template1, or if that seems painful, you could drop it and recreate it by cloning template0 (see CREATE DATABASE's TEMPLATE option). template0 exists precisely to be a virgin empty database for this sort of purpose. (There is an interlock to prevent you from dropping either of these template databases accidentally. Overriding that is left as an exercise for the student.) regards, tom lane