Re: Better support of exported snapshots with pg_dump - Mailing list pgsql-hackers

From Michael Paquier
Subject Re: Better support of exported snapshots with pg_dump
Date
Msg-id CAB7nPqQ6Qo1vbeYQhyfFcCyDybc62qdDsxvXB7oZzHKCCG98=A@mail.gmail.com
Whole thread Raw
In response to Re: Better support of exported snapshots with pg_dump  (Robert Haas <robertmhaas@gmail.com>)
Responses Re: Better support of exported snapshots with pg_dump
List pgsql-hackers
On Fri, Oct 17, 2014 at 12:19 AM, Robert Haas <robertmhaas@gmail.com> wrote:
On Wed, Oct 15, 2014 at 1:06 AM, Andres Freund <andres@2ndquadrant.com> wrote:
> I personally think we should just disregard the race here and add a
> snapshot parameter. The race is already there and not exactly
> small. Let's not kid ourselves that hiding it solves anything.
I, too, favor that plan.
Two votes in favor of that from two committers sounds like a deal. Here is an refreshed version of the patch introducing --snapshot from here, after fixing a couple of things and adding documentation:
http://www.postgresql.org/message-id/CA+U5nMK9+TTCff_-4MfdxWHnASTAuHuq7u7uedD57vaY28AsQA@mail.gmail.com

When the snapshot specified by user is not a valid one, here is the error returned by pg_dump:
$ pg_dump --snapshot 'ppo'
pg_dump: [archiver (db)] query failed: ERROR:  invalid snapshot identifier: "ppo"
pg_dump: [archiver (db)] query was: SET TRANSACTION SNAPSHOT 'ppo'
I thinks that's fine, and it makes the code lighter to rely on the existing error machinery.

Regards,
--
Michael
Attachment

pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Superuser connect during smart shutdown
Next
From: Stephen Frost
Date:
Subject: Re: Superuser connect during smart shutdown