Jan Wieck wrote:
> 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
gosh, there's the pipe missing before the psql
>
>
>
> 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 #