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


---------------------------(end of broadcast)---------------------------
TIP 4: Have you searched our list archives?

               http://archives.postgresql.org

Reply via email to