pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Jan Wieck <JanWieck@Yahoo.com>
To: ow <oneway_111@Yahoo.com>
Cc: Peter Eisentraut <peter_e@gmx.net>
Cc: pgsql-sql@postgresql.org
Subject: Re: Programatically switching database
Date: Sat, 15 Nov 2003 21:18:03 -0500
Message-ID: <3FB6DE5B.1020000@Yahoo.com> (raw)
In-Reply-To: <20031116015008.76880.qmail@web21402.mail.yahoo.com>
References: <20031116015008.76880.qmail@web21402.mail.yahoo.com>

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 #




view thread (15+ messages)  latest in thread

Message-ID: <3FB6DE5B.1020000@Yahoo.com>
Permalink:  ../3FB6DE5B.1020000@Yahoo.com/
Also on:    postgresql.org/message-id/3FB6DE5B.1020000@Yahoo.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: JanWieck@Yahoo.com, oneway_111@Yahoo.com, peter_e@gmx.net
  Subject: Re: Programatically switching database
  In-Reply-To: <3FB6DE5B.1020000@Yahoo.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox