Re: Programatically switching database

From: Jan Wieck <JanWieck(at)Yahoo(dot)com>
To: Jan Wieck <JanWieck(at)Yahoo(dot)com>
Cc: ow <oneway_111(at)Yahoo(dot)com>, Peter Eisentraut <peter_e(at)gmx(dot)net>, pgsql-sql(at)postgresql(dot)org
Subject: Re: Programatically switching database
Date: 2003-11-16 02:20:56
Message-ID: 3FB6DF08.4040603@Yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Jan Wieck wrote:

> ow wrote:
>
>> --- ow <oneway_111(at)yahoo(dot)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(at)Yahoo(dot)com #

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message ow 2003-11-16 05:18:42 Re: Programatically switching database
Previous Message Jan Wieck 2003-11-16 02:18:03 Re: Programatically switching database