Re: Programatically switching database - Mailing list pgsql-sql

From Jan Wieck
Subject Re: Programatically switching database
Date
Msg-id 3FB6DF08.4040603@Yahoo.com
Whole thread Raw
In response to Re: Programatically switching database  (Jan Wieck <JanWieck@Yahoo.com>)
List pgsql-sql
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 #



pgsql-sql by date:

Previous
From: Jan Wieck
Date:
Subject: Re: Programatically switching database
Next
From: ow
Date:
Subject: Re: Programatically switching database