Re: [GENERAL] Run statements before pg_dump in same transaction? - Mailing list pgsql-general

From John R Pierce
Subject Re: [GENERAL] Run statements before pg_dump in same transaction?
Date
Msg-id 877bb7cc-f7ba-8c26-62ac-edd4845f5d06@hogranch.com
Whole thread Raw
In response to [GENERAL] Run statements before pg_dump in same transaction?  (François Beausoleil <francois@teksol.info>)
List pgsql-general
On 3/23/2017 12:06 PM, François Beausoleil wrote:
BEGIN;
UPDATE users SET email = 'dev+' || id || '@example.com', password_hash = '/* hash of "password" */', ...;
-- launch pg_dump as usual, ensuring a ROLLBACK at the end
-- pg_dump must run with the *same* connection, obviously

-- if not already done by pg_dump
ROLLBACK;

there is no way to get pg_dump to use the same connection as your script.... its a standalone program, and will open its own connection, hence run its own transactions.


-- 
john r pierce, recycling bits in santa cruz

pgsql-general by date:

Previous
From: François Beausoleil
Date:
Subject: [GENERAL] Run statements before pg_dump in same transaction?
Next
From: John R Pierce
Date:
Subject: Re: [GENERAL] Run statements before pg_dump in same transaction?