Discussion:
Reserved keywords and qualified identifiers
cowwoc
2014-09-19 06:17:15 UTC
Permalink
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



--
View this message in context: http://postgresql.1045698.n5.nabble.com/Reserved-keywords-and-qualified-identifiers-tp5819597.html
Sent from the PostgreSQL - general mailing list archive at Nabble.com.
--
Sent via pgsql-general mailing list (pgsql-***@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general
David G Johnston
2014-09-19 07:04:39 UTC
Permalink
Post by cowwoc
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
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.
--
Sent via pgsql-general mailing list (pgsql-***@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general
Loading...