New DBs from existing schemas

Поиск
Список
Период
Сортировка
От Nishad Prakash
Тема New DBs from existing schemas
Дата
Msg-id Pine.GSO.4.58.0605241531300.27929@e4e.oac.uci.edu
обсуждение исходный текст
Ответы Re: New DBs from existing schemas  (Chris <dmagick@gmail.com>)
Re: New DBs from existing schemas  (Karsten Hilbert <Karsten.Hilbert@gmx.net>)
Список pgsql-general
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


В списке pgsql-general по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: recompliing c-language functions with new releases of postgres
Следующее
От: "Dann Corbit"
Дата:
Сообщение: Re: compiling source code!!!!!!!!!!!!!!!!!!!!!!!!!!!!!