Cannot recreate DB scheme using pg_dump

Поиск
Список
Период
Сортировка
От Nishad Prakash
Тема Cannot recreate DB scheme using pg_dump
Дата
Msg-id Pine.GSO.4.58.0407161621230.16729@e4e.oac.uci.edu
обсуждение исходный текст
Ответы Re: Cannot recreate DB scheme using pg_dump  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-bugs
I'm trying to create a new database whose schema is the same as one
that already exists.  To my surprise, the following steps don't work:

1) pg_dump -s db1 > db1_schema
2) createdb db2
3) psql -f db1_schema db2

Both db1 and db2 are created by the user "Bob", who also owns all the
tables in db1.  Now, if step (3) is performed by Bob, then C language
functions are not re-created, for lack of permission.  If step (3) is
perfomed by the postgres superuser, then certain indices and foreign
key constraints are not re-created and I see the error "must be owner
of relation <foo>".

Am I doing something wrong?  Is there a better way to do this?

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

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

Предыдущее
От: Peter Eisentraut
Дата:
Сообщение: Re: \ escapes in check constraint strings?
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Slow views