Re: Reserved keywords and qualified identifiers - Mailing list pgsql-general

From David G Johnston
Subject Re: Reserved keywords and qualified identifiers
Date
Msg-id 1411110279885-5819601.post@n5.nabble.com
Whole thread Raw
In response to Reserved keywords and qualified identifiers  (cowwoc <cowwoc@bbs.darktech.org>)
List pgsql-general
cowwoc wrote
> Hi,
>
> http://dev.mysql.com/doc/refman/5.7/en/reserved-words.html explicitly
> states that qualified identifiers do not have to be quoted even if they
> are reserved keywords ("A word that follows a period in a qualified name
> must be an identifier, so it need not be quoted even if it is reserved").
>
> http://www.postgresql.org/docs/9.3/static/sql-keywords-appendix.html does
> not seem to discuss this topic but empirical evidence seems to indicate
> PostgreSQL shares the same behavior.
>
> Is it possible to document the expected behavior? I need to know this
> information to fix this related bug:
> https://github.com/querydsl/querydsl/issues/936
>
> Thanks,
> Gili

It isn't a conscious decision - the logic noted in MySQL applies here as
well: the parser is never faced with an ambigious situation which would
cause a syntax error so the use of quotes to dis-ambiguity is not required.
Though the other effects of (reasons for) quoting identifiers in PostgreSQL
still apply.

Given your empirical evidence and the above logic it's safe to say that the
behavior you see is expected.

David J.




--
View this message in context:
http://postgresql.1045698.n5.nabble.com/Reserved-keywords-and-qualified-identifiers-tp5819597p5819601.html
Sent from the PostgreSQL - general mailing list archive at Nabble.com.


pgsql-general by date:

Previous
From: Alban Hertroys
Date:
Subject: Re: Re: How can i monitor exactly what (partition) tables are accessed by a query?
Next
From: Alban Hertroys
Date:
Subject: Re: cloning database