Thread: SQL:2003 keyword additions

SQL:2003 keyword additions

From
Simon Riggs
Date:
as per SQL:2003 Annex E pp.1173-1175 "Incompatibilities with SQL:1999",
specifically point 17, pp.1174-1175:

"A number of additional <reserved word>s have been added to the
language".

Enjoy.

--
Best Regards, Simon Riggs

Attachment

Re: SQL:2003 keyword additions

From
Peter Eisentraut
Date:
Simon Riggs wrote:
> as per SQL:2003 Annex E pp.1173-1175 "Incompatibilities with
> SQL:1999", specifically point 17, pp.1174-1175:
>
> "A number of additional <reserved word>s have been added to the
> language".

I think you are confusing keywords.c with the SQL standard.

--
Peter Eisentraut
http://developer.postgresql.org/~petere/

Re: SQL:2003 keyword additions

From
Tom Lane
Date:
Simon Riggs <simon@2ndquadrant.com> writes:
> as per SQL:2003 Annex E pp.1173-1175 "Incompatibilities with SQL:1999",
> specifically point 17, pp.1174-1175:
> "A number of additional <reserved word>s have been added to the
> language".

We are not going to reserve words simply because they are reserved in
the standard.  We go out of our way to make words as "little reserved"
as possible; words that we are not even using in the grammar don't have
to be reserved at all.

For future reference, the patch as proposed is broken anyway because it
doesn't add the keywords to the appropriate list in gram.y.

            regards, tom lane

Re: SQL:2003 keyword additions

From
Simon Riggs
Date:
On Tue, 2004-11-23 at 23:08, Peter Eisentraut wrote:
> Simon Riggs wrote:
> > as per SQL:2003 Annex E pp.1173-1175 "Incompatibilities with
> > SQL:1999", specifically point 17, pp.1174-1175:
> >
> > "A number of additional <reserved word>s have been added to the
> > language".
>
> I think you are confusing keywords.c with the SQL standard.

Hmmm... the difference was clear to me, since I edited one, but not the
other. ;)

If you are saying "we should not support the SQL standard with regard to
the new reserved words added in SQL:2003", I would understand, but not
agree.

With you lies the power to apply, all some or none of the patch, as you
choose. It was tedious enough to write the patch...

--
Best Regards, Simon Riggs


Re: SQL:2003 keyword additions

From
Simon Riggs
Date:
On Tue, 2004-11-23 at 23:22, Tom Lane wrote:
> For future reference, the patch as proposed is broken anyway because it
> doesn't add the keywords to the appropriate list in gram.y.

OK, thanks.

--
Best Regards, Simon Riggs


Re: SQL:2003 keyword additions

From
Peter Eisentraut
Date:
Simon Riggs wrote:
> If you are saying "we should not support the SQL standard with regard
> to the new reserved words added in SQL:2003", I would understand, but
> not agree.

Conformance to the SQL standard is defined such that statements that are
specified in the standard should work precisely as specified in the
standard.  It does *not* mean that statements that are not defined in
the standard should fail to work.  Therefore, adding more reserved key
words than necessary does not achieve anything in terms of SQL
conformance.

--
Peter Eisentraut
http://developer.postgresql.org/~petere/

Re: SQL:2003 keyword additions

From
Thomas Hallgren
Date:
Peter Eisentraut wrote:
> ... Therefore, adding more reserved key
> words than necessary does not achieve anything in terms of SQL
> conformance.
>
One might argue that it will prevent current PostgreSQL users from
unintentionally using those keywords and thereby obtain 2 goals:

1. The SQL code will be more portable since other databases may
recognize the keywords.
2. Migration to a future PostgreSQL version where the relevant commands
has been implemented will be easier.

Regards,
Thomas Hallgren


Re: SQL:2003 keyword additions

From
Peter Eisentraut
Date:
Thomas Hallgren wrote:
> One might argue that it will prevent current PostgreSQL users from
> unintentionally using those keywords and thereby obtain 2 goals:
>
> 1. The SQL code will be more portable since other databases may
> recognize the keywords.
> 2. Migration to a future PostgreSQL version where the relevant
> commands has been implemented will be easier.

There is, however, little to no evidence that any other SQL
implementation reserves those key words or that a future PostgreSQL
feature addition would have to reserve them.

Advising users of possibly unportable features is a valid goal, but it
is best solved as part of the SQL flagger feature that prints out
warnings for all extensions, not just some key words.  Various
discussions about the SQL flagger are in the archive.

--
Peter Eisentraut
http://developer.postgresql.org/~petere/

Re: SQL:2003 keyword additions

From
Simon Riggs
Date:
On Wed, 2004-11-24 at 10:02, Peter Eisentraut wrote:
> Simon Riggs wrote:
> > If you are saying "we should not support the SQL standard with regard
> > to the new reserved words added in SQL:2003", I would understand, but
> > not agree.
>
> Conformance to the SQL standard is defined such that statements that are
> specified in the standard should work precisely as specified in the
> standard.  It does *not* mean that statements that are not defined in
> the standard should fail to work.  Therefore, adding more reserved key
> words than necessary does not achieve anything in terms of SQL
> conformance.

Returning to your original thought, the PostgreSQL reserved word list
and the standard are not the same thing. I accept the core team's
judgement that the two should not be the same, for various reasons.

I have another suggestion on how to allow both to co-exist, which I will
detail later on Hackers.

--
Best Regards, Simon Riggs