0

How can I obtain the list of Postgres keywords? Failing a programmatic solution, where can I look inside the Postgres project to get this list?

Context: for use in a code generation tool.

4
  • You can get it from the source code: github.com/postgres/postgres/tree/master/doc/src/sgml/keywords Commented Jan 22 at 4:43
  • 3
    There is a function pg_get_keywords() Commented Jan 22 at 4:47
  • @klin, your comment would do a good candidate for an answer: although it doesn't reply directly, it resolves Mark's initial need that was to get them programmatically. Commented Jan 22 at 11:03
  • I hope the OP doesn't mind if I mark his question as a duplicate. Commented Jan 22 at 11:12

1 Answer 1

1

In the source of PostgreSQL,
you will see that doc/src/sgml/generate-keywords-table.pl combines the contents of:

You can even run it directly from the source tree:

perl ./doc/src/sgml/generate-keywords-table.pl doc/src/sgml |
    sed -e '/<token>/!d' -e 's/ *<[^>]*>//g' -e 's/&zwsp;//g'
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.