Re: synchronized snapshots

From: "Kevin Grittner" <Kevin(dot)Grittner(at)wicourts(dot)gov>
To: "Simon Riggs" <simon(at)2ndQuadrant(dot)com>, "Joachim Wieland" <joe(at)mcknight(dot)de>
Cc: "pgsql-hackers" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: synchronized snapshots
Date: 2011-08-15 14:56:00
Message-ID: 4E48ED30020000250003FEFA@gw.wicourts.gov
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Simon Riggs <simon(at)2ndQuadrant(dot)com> wrote:
> Joachim Wieland <joe(at)mcknight(dot)de> wrote:

>> BEGIN TRANSACTION ISOLATION LEVEL REPEATABLE READ (SNAPSHOT =
>> '000003A1-1');
>
> I don't see the need to change the BEGIN command, which is SQL
> Standard.

No, it's not standard.

To quote from our docs at:

http://www.postgresql.org/docs/9.0/interactive/sql-begin.html#AEN58214

| BEGIN is a PostgreSQL language extension. It is equivalent to the
| SQL-standard command START TRANSACTION, whose reference page
| contains additional compatibility information.
|
| Incidentally, the BEGIN key word is used for a different purpose
| in embedded SQL. You are advised to be careful about the
| transaction semantics when porting database applications.

In checking the most recent standards draft I have available, it
appears that besides embedded SQL, this keyword is also used in the
standard trigger declaration syntax. Using BEGIN to start a
transaction is a PostgreSQL extension to the standard. That said,
if we support a feature on the nonstandard BEGIN statement, we
typically add it as an extension to the standard START TRANSACTION
and SET TRANSACTION statements. Through 9.0 that consisted of
having a non-standard default for isolation level and the ability to
omit commas required by the standard. In 9.1 we added another
optional transaction property which defaults to standard behavior:
DEFERRABLE.

If we're talking about a property of a transaction, like the
transaction snapshot, it seems to me to be best to support it using
the same statements we use for other transaction properties.

-Kevin

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Magnus Hagander 2011-08-15 15:54:53 Re: walprotocol.h vs frontends
Previous Message Tom Lane 2011-08-15 14:53:55 Re: walprotocol.h vs frontends