pg.ddx.io pgsql-general@postgresql.org mailing list archive
help / color / mirror / Atom feedMind of its own?
4+ messages / 3 participants
[nested] [flat]
* Mind of its own?
@ 2019-03-01 00:10 s400t@yahoo.co.jp
2019-03-01 00:16 ` Re: Mind of its own? Ian Barwick <ian.barwick@2ndquadrant.com>
2019-03-01 00:24 ` Re: Mind of its own? Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 2 replies; 4+ messages in thread
From: s400t@yahoo.co.jp @ 2019-03-01 00:10 UTC (permalink / raw)
To: pgsql-general@lists.postgresql.org <pgsql-general@lists.postgresql.org>
Hopefully not, but I feel so helpless.
What happened?
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.
This is a cruel joke.
What is happening?
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: Mind of its own?
2019-03-01 00:10 Mind of its own? s400t@yahoo.co.jp
@ 2019-03-01 00:16 ` Ian Barwick <ian.barwick@2ndquadrant.com>
1 sibling, 0 replies; 4+ messages in thread
From: Ian Barwick @ 2019-03-01 00:16 UTC (permalink / raw)
To: s400t@yahoo.co.jp; pgsql-general@lists.postgresql.org <pgsql-general@lists.postgresql.org>
On 3/1/19 9:10 AM, s400t@yahoo.co.jp wrote:
> Hopefully not, but I feel so helpless.
>
> What happened?
>
> 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.
> This is a cruel joke.
>
> What is happening?
Have you tried using psql to connect directly to PostgreSQL to verify
what phppgadmin is telling you?
Regards
Ian Barwick
--
Ian Barwick https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: Mind of its own?
2019-03-01 00:10 Mind of its own? s400t@yahoo.co.jp
@ 2019-03-01 00:24 ` Tom Lane <tgl@sss.pgh.pa.us>
2019-03-01 15:15 ` Re: Mind of its own? s400t@yahoo.co.jp
1 sibling, 1 reply; 4+ messages in thread
From: Tom Lane @ 2019-03-01 00:24 UTC (permalink / raw)
To: s400t@yahoo.co.jp; +Cc: pgsql-general@lists.postgresql.org <pgsql-general@lists.postgresql.org>
<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
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: Mind of its own?
2019-03-01 00:10 Mind of its own? s400t@yahoo.co.jp
2019-03-01 00:24 ` Re: Mind of its own? Tom Lane <tgl@sss.pgh.pa.us>
@ 2019-03-01 15:15 ` s400t@yahoo.co.jp
0 siblings, 0 replies; 4+ messages in thread
From: s400t@yahoo.co.jp @ 2019-03-01 15:15 UTC (permalink / raw)
To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: pgsql-general@lists.postgresql.org <pgsql-general@lists.postgresql.org>
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
>
^ permalink raw reply [nested|flat] 4+ messages in thread
end of thread, other threads:[~2019-03-01 15:15 UTC | newest]
Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2019-03-01 00:10 Mind of its own? s400t@yahoo.co.jp
2019-03-01 00:16 ` Ian Barwick <ian.barwick@2ndquadrant.com>
2019-03-01 00:24 ` Tom Lane <tgl@sss.pgh.pa.us>
2019-03-01 15:15 ` s400t@yahoo.co.jp
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