Closed rmg closed 4 years ago
@jmafc I can switch this to the query you proposed in https://github.com/perseas/Pyrseas/issues/212#issuecomment-561901739 if that helps it get merged.
SELECT word FROM pg_get_keywords()
WHERE catcode != 'U';
@rmg Yes, I would prefer the WHERE catcode != 'U'
, please.
Done. Expanded on the commit message while I was at it (updated PR description to match).
Change filter to use any keywords not marked as non-reserved instead of only those marked as reserved. This is necessary due to how certain keywords are classified by Postgres and by the various standards.
Keyword categories (from Postgres
src/include/common/keywords.h
):U
/UNRESERVED_KEYWORD
C
/COL_NAME_KEYWORD
T
/TYPE_FUNC_NAME_KEYWORD
R
/RESERVED_KEYWORD
For example, "authorization" is reserved, but may be used as a function name, so it has a
catcode
ofT
instead ofR
, so is not quoted by the original logic.Docs: https://www.postgresql.org/docs/current/sql-keywords-appendix.html
Closes #212