Re: Programatically switching database
От | Jan Wieck |
---|---|
Тема | Re: Programatically switching database |
Дата | |
Msg-id | 3FB6DE5B.1020000@Yahoo.com обсуждение исходный текст |
Ответ на | Re: Programatically switching database (ow <oneway_111@yahoo.com>) |
Ответы |
Re: Programatically switching database
Re: Programatically switching database |
Список | pgsql-sql |
ow wrote: > --- ow <oneway_111@yahoo.com> wrote: >> How? The doc only mentions db: pg_dump [option...] [dbname] >> >> Then, how would I lock users out from the schema while it's being loaded? > > Never mind how, I see there's "-n namespace" option in 7.4. But still, how > would I lock users out from the schema while it's being loaded? #!/bin/sh ( echo "start transaction;" cat $2 echo "commit transaction;" ) psql $1 then call it as reload_in_transaction my_db my_namespace.dump Since the whole dump will be restored inside of one transaction, nobody will see it while it's reloading. Jan -- #======================================================================# # It's easier to get forgiveness for being wrong than for being right. # # Let's break this rule - forgive me. # #================================================== JanWieck@Yahoo.com #
В списке pgsql-sql по дате отправления: