ivoa-std / ADQL

Astronomical Data Query Language Standard
https://wiki.ivoa.net/twiki/bin/view/IVOA/ADQL
Creative Commons Attribution Share Alike 4.0 International
7 stars 7 forks source link

Reserved word "DOUBLE PRECISION"? #82

Closed mbtaylor closed 1 year ago

mbtaylor commented 1 year ago

In Section 2.1.4 "ADQL reserved keywords", the list for CAST function and datatypes is:

BIGINT, CAST, CHAR, DOUBLE PRECISION, INTEGER, REAL, SMALLINT, TIMESTAMP, VARCHAR

It looks funny to me having a keyword with embedded whitespace, so unless somebody that understands the syntax better than I do says so, I'd say that DOUBLE and PRECISION should appear as two separate entries in this list. The BNF production for <ADQL_reserved_word> does indeed list DOUBLE and PRECISION separately.

mbtaylor commented 1 year ago

In fact in ADQL 2.0 DOUBLE and PRECISION are listed in both the "SQL Reserved Keywords" section in the text and in the <SQL_reserved_word> BNF production, but they have been removed from both lists in ADQL 2.1 which seems strange - are they reserved in SQL92 or not? I don't have access to the SQL92 standard itself, but e.g. the SQL92 BNF found at https://ronsavage.github.io/SQL/ does list both as reserved words.

So it seems to me that in ADQL 2.1, DOUBLE and PRECISION should be restored to the SQL reserved word list and BNF production, and removed from the ADQL BNF production, and DOUBLE PRECISION should be removed from the ADQL reserved keywords section in the text. I can prepare a PR that does that if the editors agree.

msdemlei commented 1 year ago

On Mon, Apr 03, 2023 at 10:12:54AM -0700, Mark Taylor wrote:

So it seems to me that in ADQL 2.1, DOUBLE and PRECISION should be restored to the SQL reserved word list and BNF production, and removed from the ADQL BNF production, and DOUBLE PRECISION should be removed from the ADQL reserved keywords section in the text. I can prepare a PR that does that if the editors agree.

While I'm not the editor, I fully agree with this proposal.

gmantele commented 1 year ago

Honestly, I don't really have a strong opinion on this topic. So, I'll do as you think is the best :wink:

@mbtaylor I let you create this PullRequest. Before merging it, I will probably add few other commits/corrections of the same type. I generally moved keywords used in ADQL from SQL reserved keywords to ADQL reserved ones. So, I'll have to fix this the other way around for some keywords (generally related to datatypes, coalesce, ...).

Thank you for this comment :-)

mbtaylor commented 1 year ago

Thanks @gmantele, I will prepare a PR. However I may wait until #81 is resolved since it affects some of the same content and otherwise there may be commit conflicts or changes getting lost.

gmantele commented 1 year ago

All opened Pull-Requests are now merged and closed. You can prepare a new one :-)

mbtaylor commented 1 year ago

Addressed at PR #83.