pg_dump restore as transaction?

From: Owen Hartnett <owen(at)clipboardinc(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: pg_dump restore as transaction?
Date: 2008-12-01 17:29:58
Message-ID: p0624080ec559cdec47b2@[192.168.0.107]
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


If my perusal of the sql generated by pg_dump is correct, then it
doesn't appear that it's wrapped in a transaction, and thus might be
able to only complete a partial restore?

Or does

psql myDatabase <mypg_dumpfile

wrap the file stream in a transaction?

If not, is there a reason why it can't be done so (some process that
cannot be run as a transaction inside the file)?

Or should I just add begin and commit statements at the beginning and
end of file?

I want to provide a mechanized daily update of one schema into a
differently named database, and I'd like it to rollback if if fails.

-Owen

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Peter Billen 2008-12-01 17:36:24 Re: pg_dump restore as transaction?
Previous Message Tom Lane 2008-12-01 17:24:56 Re: Detecting changes to certain fields in 'before update' trigger functions