Re: Programatically switching database

From: ow <oneway_111(at)yahoo(dot)com>
To: Jan Wieck <JanWieck(at)yahoo(dot)com>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: Programatically switching database
Date: 2003-11-16 05:18:42
Message-ID: 20031116051842.57962.qmail@web21404.mail.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

--- Jan Wieck <JanWieck(at)yahoo(dot)com> wrote:
> #!/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.

Interesting idea. I know some RDBMSs that are very picky about DDL in
transactions but it appears pgSql handles it without any problems.

My concern though ... wouldn't pgSql server collapse when faced with
transaction spawning across 100M+ records? And how would that affect overall
restore time? I've should've tried it myself but I can't, my "regular"
pg_restore has been running for 4+ hours, can't kill now ...

Thanks

__________________________________
Do you Yahoo!?
Protect your identity with Yahoo! Mail AddressGuard
http://antispam.yahoo.com/whatsnewfree

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Kenneth Gonsalves 2003-11-16 07:35:20 schema
Previous Message Jan Wieck 2003-11-16 02:20:56 Re: Programatically switching database