Search Postgresql Archives

New DBs from existing schemas

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

 



I want to create a new database with the exact schema of an existing one,
but a different name.  After some reading, it seems

pg_dump -s old_db > old_schema
createdb -t old_schema new_db

should work.  Will it?  Note that old_db has lots of stored functions and
user-defined operators in addition to tables and indices.

Also, is there any way to selectively restore some of the data from old_db
into new_db as well?  I'll settle for all data if selectivity isn't
possible.  Here, I don't have any good guesses, as the docs for pg_restore
don't say anything specific about restoring into a db other than the one
dumped from.

Is there a nice way to do these things that doesn't involve pg_dump | sed?

nishad
-- 
"Underneath the concrete, the dream is still alive" -- Talking Heads



[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