Search Postgresql Archives

[Fwd: Re: Creating new database]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




--- Begin Message ---
Thank you very much for your replies.

It's clear to me from your replies that something very odd is going on, not least because I now see that if I connect with:
psql template1
I see everything in database1, including data, whereas template1 should be empty.

Luckily this is my test database, and the production database behaves normally, so it's clear that I've set up my test database all wrong (which was done from a partial pg_dump).
So I'm going to do a pg_dumpall from the production database, drop the test database and start from scratch, and try again.

Thanks,
Malcolm



Vidhya Bondre ha scritto:
can you specify the exact commands and the sequence. With this set up it should work.
 
how do you import the data.
 
Vidhya

On Wed, Nov 18, 2009 at 5:18 PM, Malcolm Warren <malcolm@xxxxxxxxxxxxxxxxx> wrote:
Dear All,


I've been using a single database for many years.
I'd now like to create a new separate database with most of the same tables, so that I don't have to re-write my code, I'd like to just use a different Tomcat datasource to access it.

I had imagined this would be as simple as :
1) using createdb, to create a database with a different name, maybe with a different postgres user assigned to it,
2) using a pg_dump from the original database to import the table creation.

However it doesn't appear to be that simple.

Let's say the old database is called database1, and I've created a new database2.

When I import the pg_dump into database2, it tells me that the tables already exist (obviously it's talking about the tables in database1).
But I surely I've created a new database called database2? Why is it stopping me from creating the same tables in the new database?

Same sort of problem with psql:
If I run 'psql database2' then I see everything from database1 as well.
What am I missing here?



Thanks for your time.

Malcolm Warren







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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux