Re: SET TRANSACTION and SQL Standard

From: Simon Riggs <simon(at)2ndQuadrant(dot)com>
To: Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
Cc: Peter Eisentraut <peter_e(at)gmx(dot)net>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: SET TRANSACTION and SQL Standard
Date: 2009-01-09 16:13:19
Message-ID: 1231517599.18005.462.camel@ebony.2ndQuadrant
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


On Fri, 2009-01-09 at 17:11 +0200, Heikki Linnakangas wrote:
> Simon Riggs wrote:
> > On Fri, 2009-01-09 at 16:14 +0200, Peter Eisentraut wrote:
> >> Simon Riggs wrote:
> >>> I notice that we allow commands such as
> >>>
> >>> SET TRANSACTION read only read write read only;
> >>>
> >>> BEGIN TRANSACTION read only read only read only;
> >>>
> >>> Unsurprisingly, these violate the SQL Standard:
> >>> * p.977 section 19.1 syntax (1)
> >>> * p.957 section 17.3 syntax (2)
> >> Well, we allow a lot of things. Violations of the SQL standard happen
> >> when a command that appears in the standard doesn't do what the standard
> >> says. Allowing commands that are not in the standard is not a violation.
> >
> > Except when the standard explicitly forbids it, as with the above.
>
> No, it just means that the statement "SET TRANSACTION read only read
> write read only;" doesn't conform to the standard, and it's therefore
> implementation-dependent what it does. See the meaning of "shall" in
> Syntax Rules, section "6.3.3.2 Terms denoting rule requirements".

which says

"If any condition required by Syntax Rules is not satisfied when the
evaluation of Access or General Rules is attempted and the
implementation is neither processing non-conforming SQL language nor
processing conforming SQL language in a non-conforming manner, then an
exception condition is raised: syntax error or access rule violation."

If we *choose* to be an SQL implementation that conforms to the SQL
standard, then it should throw an error.

Of course, we can *choose* not to conform to the standard in this or any
case, but exactly why would we? I thought we had made a choice to
conform to the SQL Standard, unless we have specific reason not to.

--
Simon Riggs www.2ndQuadrant.com
PostgreSQL Training, Services and Support

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2009-01-09 16:15:08 Re: Improving compressibility of WAL files
Previous Message Tom Lane 2009-01-09 16:12:05 Re: Solve a problem of LC_TIME of windows.