1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-15 19:21:59 +03:00

Add a function pg_get_keywords() to let clients find out the set of keywords

known to the SQL parser.  Dave Page
This commit is contained in:
Tom Lane
2008-07-03 20:58:47 +00:00
parent e3d9dceef6
commit c63147d6f0
7 changed files with 109 additions and 9 deletions

View File

@ -1,4 +1,4 @@
<!-- $PostgreSQL: pgsql/doc/src/sgml/func.sgml,v 1.437 2008/05/19 18:08:15 tgl Exp $ -->
<!-- $PostgreSQL: pgsql/doc/src/sgml/func.sgml,v 1.438 2008/07/03 20:58:46 tgl Exp $ -->
<chapter id="functions">
<title>Functions and Operators</title>
@ -11484,6 +11484,10 @@ SELECT pg_type_is_visible('myschema.widget'::regtype);
<primary>format_type</primary>
</indexterm>
<indexterm>
<primary>pg_get_keywords</primary>
</indexterm>
<indexterm>
<primary>pg_get_viewdef</primary>
</indexterm>
@ -11538,6 +11542,11 @@ SELECT pg_type_is_visible('myschema.widget'::regtype);
<entry><type>text</type></entry>
<entry>get SQL name of a data type</entry>
</row>
<row>
<entry><literal><function>pg_get_keywords</function>()</literal></entry>
<entry><type>setof record</type></entry>
<entry>get list of SQL keywords and their categories</entry>
</row>
<row>
<entry><literal><function>pg_get_constraintdef</function>(<parameter>constraint_oid</parameter>)</literal></entry>
<entry><type>text</type></entry>
@ -11633,6 +11642,16 @@ SELECT pg_type_is_visible('myschema.widget'::regtype);
for the type modifier if no specific modifier is known.
</para>
<para>
<function>pg_get_keywords</function> returns a set of records describing
the SQL keywords recognized by the server. The <structfield>word</> column
contains the keyword. The <structfield>catcode</> column contains a
category code: <literal>U</> for unreserved, <literal>C</> for column name,
<literal>T</> for type or function name, or <literal>R</> for reserved.
The <structfield>catdesc</> column contains a possibly-localized string
describing the category.
</para>
<para>
<function>pg_get_constraintdef</function>,
<function>pg_get_indexdef</function>, <function>pg_get_ruledef</function>,