pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: s400t@yahoo.co.jp
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-general@lists.postgresql.org <pgsql-general@lists.postgresql.org>
Subject: Re: Mind of its own?
Date: Sat, 2 Mar 2019 00:15:37 +0900 (JST)
Message-ID: <871505622.1579923.1551453337845.JavaMail.yahoo@mail.yahoo.co.jp> (raw)
In-Reply-To: <4099.1551399886@sss.pgh.pa.us>
References: <620929187.763288.1551399043803.JavaMail.yahoo.ref@mail.yahoo.co.jp>
	<620929187.763288.1551399043803.JavaMail.yahoo@mail.yahoo.co.jp>
	<4099.1551399886@sss.pgh.pa.us>

JD, IB, TL:

Yes!!! I found the whole bunch of tables in template 1!


It's so liberating. 

Thank you.





----- Original Message -----
> From: Tom Lane <tgl@sss.pgh.pa.us>
> To: s400t@yahoo.co.jp
> Cc: "pgsql-general@lists.postgresql.org" <pgsql-general@lists.postgresql.org>
> Date: 2019/2/28, Thu 17:24
> Subject: Re: Mind of its own?
> 
>& lt;s400t@yahoo.co.jp> 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 or 
> different name, all those tables are already inside that database!!! I have not 
> run the table create script. 
> 
> 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
> 





view thread (4+ messages)

Message-ID: <871505622.1579923.1551453337845.JavaMail.yahoo@mail.yahoo.co.jp>
Permalink:  ../871505622.1579923.1551453337845.JavaMail.yahoo@mail.yahoo.co.jp/
Also on:    postgresql.org/message-id/871505622.1579923.1551453337845.JavaMail.yahoo@mail.yahoo.co.jp

 · 

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-general@postgresql.org
  Cc: s400t@yahoo.co.jp, tgl@sss.pgh.pa.us
  Subject: Re: Mind of its own?
  In-Reply-To: <871505622.1579923.1551453337845.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> <4099.1551399886@sss.pgh.pa.us> <871505622.1579923.1551453337845.JavaMail.yahoo@mail.yahoo.co.jp>

* 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