pg_get_keywords()

列出所有SQL关键字的函数

pg_get_keywords() 是一个系统函数,返回PostgreSQL识别到的所有SQL关键字。

pg_get_keywords()PostgreSQL 8.4 中添加。

用法

pg_get_keywords () →
         setof record ( word text, catcode "char", barelabel boolean, catdesc text, baredesc text )

PostgreSQL 13 及更早版本

pg_get_keywords () → setof record ( word text, catcode "char", catdesc text )

变更历史

示例

来自 pg_get_keywords() 的示例输出

postgres=# SELECT * FROM pg_get_keywords() ORDER BY random() LIMIT 10;
    word     | catcode | barelabel |                   catdesc                    |     baredesc      
-------------+---------+-----------+----------------------------------------------+-------------------
 recursive   | U       | t         | unreserved                                   | can be bare label
 old         | U       | t         | unreserved                                   | can be bare label
 time        | C       | t         | unreserved (cannot be function or type name) | can be bare label
 implicit    | U       | t         | unreserved                                   | can be bare label
 publication | U       | t         | unreserved                                   | can be bare label
 variadic    | R       | t         | reserved                                     | can be bare label
 function    | U       | t         | unreserved                                   | can be bare label
 xmlroot     | C       | t         | unreserved (cannot be function or type name) | can be bare label
 execute     | U       | t         | unreserved                                   | can be bare label
 collation   | T       | t         | reserved (can be function or type name)      | can be bare label
(10 rows)

PostgreSQL 13 及更早版本

postgres=# SELECT * FROM pg_get_keywords() ORDER BY random() LIMIT 10;
      word       | catcode |                   catdesc                    
-----------------+---------+----------------------------------------------
 double          | U       | unreserved
 xmlparse        | C       | unreserved (cannot be function or type name)
 label           | U       | unreserved
 case            | R       | reserved
 current_time    | R       | reserved
 freeze          | T       | reserved (can be function or type name)
 substring       | C       | unreserved (cannot be function or type name)
 subscription    | U       | unreserved
 characteristics | U       | unreserved
 family          | U       | unreserved
(10 rows)

分类

系统函数

反馈

提交任何关于 "pg_get_keywords()" 的评论、建议或更正 此处