Re: Run statements before pg_dump in same transaction?

From: John R Pierce <pierce(at)hogranch(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Run statements before pg_dump in same transaction?
Date: 2017-03-23 19:18:15
Message-ID: 877bb7cc-f7ba-8c26-62ac-edd4845f5d06@hogranch.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message John R Pierce 2017-03-23 19:23:05 Re: Run statements before pg_dump in same transaction?
Previous Message François Beausoleil 2017-03-23 19:06:47 Run statements before pg_dump in same transaction?