关闭

PostgresSQL使用命令

126人阅读 评论(0) 收藏 举报
分类:

本章提供了PostgreSQL的SQL命令,这些命令的准确语法规则。这组命令是从psql的命令行工具。上一节我们已经安装Postgres,直接打开psql:

Program Files > PostgreSQL 9.2 > SQL Shell(psql).

使用psql的时候,可以生成完整的命令列表使用的\ help命令。对于一个特定的命令的语法使用下面的命令:

<span class="pln" style="padding: 0px; margin: 0px;"> postgres</span><span class="pun" style="padding: 0px; margin: 0px;">-#</span><span class="pln" style="padding: 0px; margin: 0px;"> \help </span><span class="str" style="padding: 0px; margin: 0px;"><command_name></span>

SQL语句

一个SQL语句,包括令牌,每个令牌可以代表一个关键字,标识符,带引号的标识符,常量,或特殊的字符符号。以下表格使用简单的SELECT语句来说明一个基本的,完整的SQL语句及其组件。

  SELECT id, name FROM states
Token Type Keyword Identifiers Keyword Identifier
Description Command Id and name columns Clause Table name

PostgreSQL的SQL命令

ABORT

中止当前事务。

<span class="pln" style="padding: 0px; margin: 0px;">ABORT </span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> WORK </span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;"> TRANSACTION </span><span class="pun" style="padding: 0px; margin: 0px;">]</span>

ALTER AGGREGATE

更改聚合函数的定义。

<span class="pln" style="padding: 0px; margin: 0px;">ALTER AGGREGATE name </span><span class="pun" style="padding: 0px; margin: 0px;">(</span><span class="pln" style="padding: 0px; margin: 0px;"> type </span><span class="pun" style="padding: 0px; margin: 0px;">)</span><span class="pln" style="padding: 0px; margin: 0px;"> RENAME TO new_name
ALTER AGGREGATE name </span><span class="pun" style="padding: 0px; margin: 0px;">(</span><span class="pln" style="padding: 0px; margin: 0px;"> type </span><span class="pun" style="padding: 0px; margin: 0px;">)</span><span class="pln" style="padding: 0px; margin: 0px;"> OWNER TO new_owner</span>

ALTER CONVERSION

更改一个转换的定义。

<span class="pln" style="padding: 0px; margin: 0px;">ALTER CONVERSION name RENAME TO new_name
ALTER CONVERSION name OWNER TO new_owner</span>

ALTER DATABASE

更改数据库的具体参数。

<span class="pln" style="padding: 0px; margin: 0px;">ALTER DATABASE name SET parameter </span><span class="pun" style="padding: 0px; margin: 0px;">{</span><span class="pln" style="padding: 0px; margin: 0px;"> TO </span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">=</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">}</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">{</span><span class="pln" style="padding: 0px; margin: 0px;"> value </span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;"> DEFAULT </span><span class="pun" style="padding: 0px; margin: 0px;">}</span><span class="pln" style="padding: 0px; margin: 0px;">
ALTER DATABASE name RESET parameter
ALTER DATABASE name RENAME TO new_name
ALTER DATABASE name OWNER TO new_owner</span>

ALTER DOMAIN

变更的定义域的具体参数。

<span class="pln" style="padding: 0px; margin: 0px;">ALTER DOMAIN name </span><span class="pun" style="padding: 0px; margin: 0px;">{</span><span class="pln" style="padding: 0px; margin: 0px;"> SET DEFAULT expression </span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;"> DROP DEFAULT </span><span class="pun" style="padding: 0px; margin: 0px;">}</span><span class="pln" style="padding: 0px; margin: 0px;">
ALTER DOMAIN name </span><span class="pun" style="padding: 0px; margin: 0px;">{</span><span class="pln" style="padding: 0px; margin: 0px;"> SET </span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;"> DROP </span><span class="pun" style="padding: 0px; margin: 0px;">}</span><span class="pln" style="padding: 0px; margin: 0px;"> NOT NULL
ALTER DOMAIN name ADD domain_constraint
ALTER DOMAIN name DROP CONSTRAINT constraint_name </span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> RESTRICT </span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;"> CASCADE </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;">
ALTER DOMAIN name OWNER TO new_owner</span>

ALTER FUNCTION

改变它的定义了一个函数。

<span class="pln" style="padding: 0px; margin: 0px;">ALTER FUNCTION name </span><span class="pun" style="padding: 0px; margin: 0px;">(</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> type </span><span class="pun" style="padding: 0px; margin: 0px;">[,</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">...]</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">)</span><span class="pln" style="padding: 0px; margin: 0px;"> RENAME TO new_name
ALTER FUNCTION name </span><span class="pun" style="padding: 0px; margin: 0px;">(</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> type </span><span class="pun" style="padding: 0px; margin: 0px;">[,</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">...]</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">)</span><span class="pln" style="padding: 0px; margin: 0px;"> OWNER TO new_owner</span>

ALTER GROUP

更改用户组

<span class="pln" style="padding: 0px; margin: 0px;">ALTER GROUP groupname ADD USER username </span><span class="pun" style="padding: 0px; margin: 0px;">[,</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">...</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;">
ALTER GROUP groupname DROP USER username </span><span class="pun" style="padding: 0px; margin: 0px;">[,</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">...</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;">
ALTER GROUP groupname RENAME TO new_name</span>

ALTER INDEX

更改索引的定义

<span class="pln" style="padding: 0px; margin: 0px;">ALTER INDEX name OWNER TO new_owner
ALTER INDEX name SET TABLESPACE indexspace_name
ALTER INDEX name RENAME TO new_name</span>

ALTER LANGUAGE

更改程序语言的定义.

<span class="pln" style="padding: 0px; margin: 0px;">ALTER LANGUAGE name RENAME TO new_name</span>

ALTER OPERATOR

更改操作员的定义.

<span class="pln" style="padding: 0px; margin: 0px;">ALTER OPERATOR name </span><span class="pun" style="padding: 0px; margin: 0px;">(</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">{</span><span class="pln" style="padding: 0px; margin: 0px;"> lefttype </span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;"> NONE </span><span class="pun" style="padding: 0px; margin: 0px;">}</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">,</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">{</span><span class="pln" style="padding: 0px; margin: 0px;"> righttype </span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;"> NONE </span><span class="pun" style="padding: 0px; margin: 0px;">}</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">)</span><span class="pln" style="padding: 0px; margin: 0px;">
OWNER TO new_owner</span>

ALTER OPERATOR CLASS

改变一个操作符的定义.

<span class="pln" style="padding: 0px; margin: 0px;">ALTER OPERATOR CLASS name USING index_method RENAME TO new_name
ALTER OPERATOR CLASS name USING index_method OWNER TO new_owner</span>

ALTER SCHEMA

更改一个模式的定义.

<span class="pln" style="padding: 0px; margin: 0px;">ALTER SCHEMA name RENAME TO new_name
ALTER SCHEMA name OWNER TO new_owner</span>

ALTER SEQUENCE

更改序列发生器的定义.

<span class="pln" style="padding: 0px; margin: 0px;">ALTER SEQUENCE name </span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> INCREMENT </span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> BY </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;"> increment </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;">
</span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> MINVALUE minvalue </span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;"> NO MINVALUE </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;">
</span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> MAXVALUE maxvalue </span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;"> NO MAXVALUE </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;">
</span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> RESTART </span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> WITH </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;"> start </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> CACHE cache </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> NO </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;"> CYCLE </span><span class="pun" style="padding: 0px; margin: 0px;">]</span>

ALTER TABLE

更改的表的定义.

<span class="pln" style="padding: 0px; margin: 0px;">ALTER TABLE </span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> ONLY </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;"> name </span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">*</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;">
action </span><span class="pun" style="padding: 0px; margin: 0px;">[,</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">...</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;">
ALTER TABLE </span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> ONLY </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;"> name </span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">*</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;">
RENAME </span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> COLUMN </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;"> column TO new_column
ALTER TABLE name
RENAME TO new_name</span>

动作是以下行之一:

<span class="pln" style="padding: 0px; margin: 0px;">ADD </span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> COLUMN </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;"> column_type </span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> column_constraint </span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">...</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;">
DROP </span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> COLUMN </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;"> column </span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> RESTRICT </span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;"> CASCADE </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;">
ALTER </span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> COLUMN </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;"> column TYPE type </span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> USING expression </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;">
ALTER </span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> COLUMN </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;"> column SET DEFAULT expression
ALTER </span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> COLUMN </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;"> column DROP DEFAULT
ALTER </span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> COLUMN </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;"> column </span><span class="pun" style="padding: 0px; margin: 0px;">{</span><span class="pln" style="padding: 0px; margin: 0px;"> SET </span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;"> DROP </span><span class="pun" style="padding: 0px; margin: 0px;">}</span><span class="pln" style="padding: 0px; margin: 0px;"> NOT NULL
ALTER </span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> COLUMN </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;"> column SET STATISTICS integer
ALTER </span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> COLUMN </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;"> column SET STORAGE </span><span class="pun" style="padding: 0px; margin: 0px;">{</span><span class="pln" style="padding: 0px; margin: 0px;"> PLAIN </span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;"> EXTERNAL </span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;"> EXTENDED </span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;"> MAIN </span><span class="pun" style="padding: 0px; margin: 0px;">}</span><span class="pln" style="padding: 0px; margin: 0px;">
ADD table_constraint
DROP CONSTRAINT constraint_name </span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> RESTRICT </span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;"> CASCADE </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;">
CLUSTER ON index_name
SET WITHOUT CLUSTER
SET WITHOUT OIDS
OWNER TO new_owner
SET TABLESPACE tablespace_name</span>

ALTER TABLESPACE

更改一个表空间的定义.

<span class="pln" style="padding: 0px; margin: 0px;">ALTER TABLESPACE name RENAME TO new_name
ALTER TABLESPACE name OWNER TO new_owner</span>

ALTER TRIGGER

改变一个触发器的定义.

<span class="pln" style="padding: 0px; margin: 0px;">ALTER TRIGGER name ON table RENAME TO new_name</span>

ALTER TYPE

Change the definition of a type.

<span class="pln" style="padding: 0px; margin: 0px;">ALTER TYPE name OWNER TO new_owner</span>

ALTER USER

更改数据库用户帐户

<span class="pln" style="padding: 0px; margin: 0px;">ALTER USER name </span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> WITH </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;"> option </span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">...</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;">
ALTER USER name RENAME TO new_name
ALTER USER name SET parameter </span><span class="pun" style="padding: 0px; margin: 0px;">{</span><span class="pln" style="padding: 0px; margin: 0px;"> TO </span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">=</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">}</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">{</span><span class="pln" style="padding: 0px; margin: 0px;"> value </span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;"> DEFAULT </span><span class="pun" style="padding: 0px; margin: 0px;">}</span><span class="pln" style="padding: 0px; margin: 0px;">
ALTER USER name RESET parameter</span>

选项​​可以是:

<span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> ENCRYPTED </span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;"> UNENCRYPTED </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;"> PASSWORD </span><span class="str" style="padding: 0px; margin: 0px;">'password'</span><span class="pln" style="padding: 0px; margin: 0px;">
</span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;"> CREATEDB </span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;"> NOCREATEDB
</span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;"> CREATEUSER </span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;"> NOCREATEUSER
</span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;"> VALID UNTIL </span><span class="str" style="padding: 0px; margin: 0px;">'abstime'</span>

ANALYZE

收集数据库的统计信息.

<span class="pln" style="padding: 0px; margin: 0px;">ANALYZE </span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> VERBOSE </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> table </span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">(</span><span class="pln" style="padding: 0px; margin: 0px;">column </span><span class="pun" style="padding: 0px; margin: 0px;">[,</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">...]</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">)</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">]</span>

BEGIN

Start a transaction block.

<span class="kwd" style="padding: 0px; margin: 0px;">BEGIN</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> WORK </span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;"> TRANSACTION </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> transaction_mode </span><span class="pun" style="padding: 0px; margin: 0px;">[,</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">...]</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">]</span>

transaction_mode是其中一个:

<span class="pln" style="padding: 0px; margin: 0px;">ISOLATION LEVEL </span><span class="pun" style="padding: 0px; margin: 0px;">{</span><span class="pln" style="padding: 0px; margin: 0px;"> SERIALIZABLE </span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;"> REPEATABLE READ </span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;"> READ COMMITTED
</span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;"> READ UNCOMMITTED </span><span class="pun" style="padding: 0px; margin: 0px;">}</span><span class="pln" style="padding: 0px; margin: 0px;">
READ WRITE </span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;"> READ ONLY</span>

CHECKPOINT

强制事务处理日志检查点.

<span class="pln" style="padding: 0px; margin: 0px;">CHECKPOINT</span>

CLOSE

关闭游标.

<span class="pln" style="padding: 0px; margin: 0px;">CLOSE name</span>

CLUSTER

根据索引集群表.

<span class="pln" style="padding: 0px; margin: 0px;">CLUSTER index_name ON table_name
CLUSTER table_name
CLUSTER</span>

COMMENT

定义或改变一个对象的注释.

<span class="pln" style="padding: 0px; margin: 0px;">COMMENT ON
</span><span class="pun" style="padding: 0px; margin: 0px;">{</span><span class="pln" style="padding: 0px; margin: 0px;">
TABLE object_name </span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;">
COLUMN table_name</span><span class="pun" style="padding: 0px; margin: 0px;">.</span><span class="pln" style="padding: 0px; margin: 0px;">column_name </span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;">
AGGREGATE agg_name </span><span class="pun" style="padding: 0px; margin: 0px;">(</span><span class="pln" style="padding: 0px; margin: 0px;">agg_type</span><span class="pun" style="padding: 0px; margin: 0px;">)</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;">
CAST </span><span class="pun" style="padding: 0px; margin: 0px;">(</span><span class="pln" style="padding: 0px; margin: 0px;">source_type AS target_type</span><span class="pun" style="padding: 0px; margin: 0px;">)</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;">
CONSTRAINT constraint_name ON table_name </span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;">
CONVERSION object_name </span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;">
DATABASE object_name </span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;">
DOMAIN object_name </span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;">
FUNCTION func_name </span><span class="pun" style="padding: 0px; margin: 0px;">(</span><span class="pln" style="padding: 0px; margin: 0px;">arg1_type</span><span class="pun" style="padding: 0px; margin: 0px;">,</span><span class="pln" style="padding: 0px; margin: 0px;"> arg2_type</span><span class="pun" style="padding: 0px; margin: 0px;">,</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">...)</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;">
INDEX object_name </span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;">
LARGE OBJECT large_object_oid </span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;">
OPERATOR op </span><span class="pun" style="padding: 0px; margin: 0px;">(</span><span class="pln" style="padding: 0px; margin: 0px;">left_operand_type</span><span class="pun" style="padding: 0px; margin: 0px;">,</span><span class="pln" style="padding: 0px; margin: 0px;"> right_operand_type</span><span class="pun" style="padding: 0px; margin: 0px;">)</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;">
OPERATOR CLASS object_name USING index_method </span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;">
</span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> PROCEDURAL </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;"> LANGUAGE object_name </span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;">
RULE rule_name ON table_name </span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;">
SCHEMA object_name </span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;">
SEQUENCE object_name </span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;">
TRIGGER trigger_name ON table_name </span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;">
TYPE object_name </span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;">
VIEW object_name
</span><span class="pun" style="padding: 0px; margin: 0px;">}</span><span class="pln" style="padding: 0px; margin: 0px;"> IS </span><span class="str" style="padding: 0px; margin: 0px;">'text'</span>

COMMIT

提交当前事务.

<span class="pln" style="padding: 0px; margin: 0px;">COMMIT </span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> WORK </span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;"> TRANSACTION </span><span class="pun" style="padding: 0px; margin: 0px;">]</span>

COPY

Copy data between a file and a table.

<span class="pln" style="padding: 0px; margin: 0px;">COPY table_name </span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">(</span><span class="pln" style="padding: 0px; margin: 0px;"> column </span><span class="pun" style="padding: 0px; margin: 0px;">[,</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">...]</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">)</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;">
FROM </span><span class="pun" style="padding: 0px; margin: 0px;">{</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="str" style="padding: 0px; margin: 0px;">'filename'</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;"> STDIN </span><span class="pun" style="padding: 0px; margin: 0px;">}</span><span class="pln" style="padding: 0px; margin: 0px;">
</span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> WITH </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;">
</span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> BINARY </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;">
</span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> OIDS </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;">
</span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> DELIMITER </span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> AS </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="str" style="padding: 0px; margin: 0px;">'delimiter'</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;">
</span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> NULL </span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> AS </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="str" style="padding: 0px; margin: 0px;">'null string'</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;">
</span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> CSV </span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> QUOTE </span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> AS </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="str" style="padding: 0px; margin: 0px;">'quote'</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;">
</span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> ESCAPE </span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> AS </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="str" style="padding: 0px; margin: 0px;">'escape'</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;">
</span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> FORCE NOT NULL column </span><span class="pun" style="padding: 0px; margin: 0px;">[,</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">...]</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;">
COPY table_name </span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">(</span><span class="pln" style="padding: 0px; margin: 0px;"> column </span><span class="pun" style="padding: 0px; margin: 0px;">[,</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">...]</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">)</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;">
TO </span><span class="pun" style="padding: 0px; margin: 0px;">{</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="str" style="padding: 0px; margin: 0px;">'filename'</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;"> STDOUT </span><span class="pun" style="padding: 0px; margin: 0px;">}</span><span class="pln" style="padding: 0px; margin: 0px;">
</span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> WITH </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;">
</span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> BINARY </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;">
</span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> OIDS </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;">
</span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> DELIMITER </span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> AS </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="str" style="padding: 0px; margin: 0px;">'delimiter'</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;">
</span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> NULL </span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> AS </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="str" style="padding: 0px; margin: 0px;">'null string'</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;">
</span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> CSV </span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> QUOTE </span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> AS </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="str" style="padding: 0px; margin: 0px;">'quote'</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;">
</span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> ESCAPE </span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> AS </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="str" style="padding: 0px; margin: 0px;">'escape'</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;">
</span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> FORCE QUOTE column </span><span class="pun" style="padding: 0px; margin: 0px;">[,</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">...]</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">]</span>

CREATE AGGREGATE

Define a new aggregate function.

<span class="pln" style="padding: 0px; margin: 0px;">CREATE AGGREGATE name </span><span class="pun" style="padding: 0px; margin: 0px;">(</span><span class="pln" style="padding: 0px; margin: 0px;">
BASETYPE </span><span class="pun" style="padding: 0px; margin: 0px;">=</span><span class="pln" style="padding: 0px; margin: 0px;"> input_data_type</span><span class="pun" style="padding: 0px; margin: 0px;">,</span><span class="pln" style="padding: 0px; margin: 0px;">
SFUNC </span><span class="pun" style="padding: 0px; margin: 0px;">=</span><span class="pln" style="padding: 0px; margin: 0px;"> sfunc</span><span class="pun" style="padding: 0px; margin: 0px;">,</span><span class="pln" style="padding: 0px; margin: 0px;">
STYPE </span><span class="pun" style="padding: 0px; margin: 0px;">=</span><span class="pln" style="padding: 0px; margin: 0px;"> state_data_type
</span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">,</span><span class="pln" style="padding: 0px; margin: 0px;"> FINALFUNC </span><span class="pun" style="padding: 0px; margin: 0px;">=</span><span class="pln" style="padding: 0px; margin: 0px;"> ffunc </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;">
</span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">,</span><span class="pln" style="padding: 0px; margin: 0px;"> INITCOND </span><span class="pun" style="padding: 0px; margin: 0px;">=</span><span class="pln" style="padding: 0px; margin: 0px;"> initial_condition </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;">
</span><span class="pun" style="padding: 0px; margin: 0px;">)</span>

CREATE CAST

Define a new cast.

<span class="pln" style="padding: 0px; margin: 0px;">CREATE CAST </span><span class="pun" style="padding: 0px; margin: 0px;">(</span><span class="pln" style="padding: 0px; margin: 0px;">source_type AS target_type</span><span class="pun" style="padding: 0px; margin: 0px;">)</span><span class="pln" style="padding: 0px; margin: 0px;">
WITH FUNCTION func_name </span><span class="pun" style="padding: 0px; margin: 0px;">(</span><span class="pln" style="padding: 0px; margin: 0px;">arg_types</span><span class="pun" style="padding: 0px; margin: 0px;">)</span><span class="pln" style="padding: 0px; margin: 0px;">
</span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> AS ASSIGNMENT </span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;"> AS IMPLICIT </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;">
CREATE CAST </span><span class="pun" style="padding: 0px; margin: 0px;">(</span><span class="pln" style="padding: 0px; margin: 0px;">source_type AS target_type</span><span class="pun" style="padding: 0px; margin: 0px;">)</span><span class="pln" style="padding: 0px; margin: 0px;">
WITHOUT FUNCTION
</span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> AS ASSIGNMENT </span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;"> AS IMPLICIT </span><span class="pun" style="padding: 0px; margin: 0px;">]</span>

CREATE CONSTRAINT TRIGGER

定义一个新的约束触发器

<span class="pln" style="padding: 0px; margin: 0px;">CREATE CONSTRAINT TRIGGER name
AFTER events ON
table_name constraint attributes
FOR EACH ROW EXECUTE PROCEDURE func_name </span><span class="pun" style="padding: 0px; margin: 0px;">(</span><span class="pln" style="padding: 0px; margin: 0px;"> args </span><span class="pun" style="padding: 0px; margin: 0px;">)</span>

CREATE CONVERSION

定义一个新的转换

<span class="pln" style="padding: 0px; margin: 0px;">CREATE </span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;">DEFAULT</span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;"> CONVERSION name
FOR source_encoding TO dest_encoding FROM func_name</span>

CREATE DATABASE

创建一个新的数据库.

<span class="pln" style="padding: 0px; margin: 0px;">CREATE DATABASE name
</span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> WITH </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> OWNER </span><span class="pun" style="padding: 0px; margin: 0px;">[=]</span><span class="pln" style="padding: 0px; margin: 0px;"> db_owner </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;">
</span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> TEMPLATE </span><span class="pun" style="padding: 0px; margin: 0px;">[=]</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="kwd" style="padding: 0px; margin: 0px;">template</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;">
</span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> ENCODING </span><span class="pun" style="padding: 0px; margin: 0px;">[=]</span><span class="pln" style="padding: 0px; margin: 0px;"> encoding </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;">
</span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> TABLESPACE </span><span class="pun" style="padding: 0px; margin: 0px;">[=]</span><span class="pln" style="padding: 0px; margin: 0px;"> tablespace </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">]</span>

CREATE DOMAIN

定义一个新的域.

<span class="pln" style="padding: 0px; margin: 0px;">CREATE DOMAIN name </span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;">AS</span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;"> data_type
</span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> DEFAULT expression </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;">
</span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> constraint </span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">...</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">]</span>

Where constraint is:

<span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> CONSTRAINT constraint_name </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;">
</span><span class="pun" style="padding: 0px; margin: 0px;">{</span><span class="pln" style="padding: 0px; margin: 0px;"> NOT NULL </span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;"> NULL </span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;"> CHECK </span><span class="pun" style="padding: 0px; margin: 0px;">(</span><span class="pln" style="padding: 0px; margin: 0px;">expression</span><span class="pun" style="padding: 0px; margin: 0px;">)</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">}</span>

CREATE FUNCTION

定义一个新的函数.

<span class="pln" style="padding: 0px; margin: 0px;">CREATE </span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> OR REPLACE </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;"> FUNCTION name </span><span class="pun" style="padding: 0px; margin: 0px;">(</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> arg_name </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;"> arg_type </span><span class="pun" style="padding: 0px; margin: 0px;">[,</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">...]</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">)</span><span class="pln" style="padding: 0px; margin: 0px;">
RETURNS ret_type
</span><span class="pun" style="padding: 0px; margin: 0px;">{</span><span class="pln" style="padding: 0px; margin: 0px;"> LANGUAGE lang_name
</span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;"> IMMUTABLE </span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;"> STABLE </span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;"> VOLATILE
</span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;"> CALLED ON NULL INPUT </span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;"> RETURNS NULL ON NULL INPUT </span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;"> STRICT
</span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> EXTERNAL </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;"> SECURITY INVOKER </span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> EXTERNAL </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;"> SECURITY DEFINER
</span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;"> AS </span><span class="str" style="padding: 0px; margin: 0px;">'definition'</span><span class="pln" style="padding: 0px; margin: 0px;">
</span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;"> AS </span><span class="str" style="padding: 0px; margin: 0px;">'obj_file'</span><span class="pun" style="padding: 0px; margin: 0px;">,</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="str" style="padding: 0px; margin: 0px;">'link_symbol'</span><span class="pln" style="padding: 0px; margin: 0px;">
</span><span class="pun" style="padding: 0px; margin: 0px;">}</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">...</span><span class="pln" style="padding: 0px; margin: 0px;">
</span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> WITH </span><span class="pun" style="padding: 0px; margin: 0px;">(</span><span class="pln" style="padding: 0px; margin: 0px;"> attribute </span><span class="pun" style="padding: 0px; margin: 0px;">[,</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">...]</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">)</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">]</span>

CREATE GROUP

定义一个新的用户组.

<span class="pln" style="padding: 0px; margin: 0px;">CREATE GROUP name </span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> WITH </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;"> option </span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">...</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;">
</span><span class="typ" style="padding: 0px; margin: 0px;">Where</span><span class="pln" style="padding: 0px; margin: 0px;"> option can be</span><span class="pun" style="padding: 0px; margin: 0px;">:</span><span class="pln" style="padding: 0px; margin: 0px;">
SYSID gid
</span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;"> USER username </span><span class="pun" style="padding: 0px; margin: 0px;">[,</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">...]</span>

CREATE INDEX

定义一个新的索引.

<span class="pln" style="padding: 0px; margin: 0px;">CREATE </span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> UNIQUE </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;"> INDEX name ON table </span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> USING method </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;">
</span><span class="pun" style="padding: 0px; margin: 0px;">(</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">{</span><span class="pln" style="padding: 0px; margin: 0px;"> column </span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">(</span><span class="pln" style="padding: 0px; margin: 0px;"> expression </span><span class="pun" style="padding: 0px; margin: 0px;">)</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">}</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> opclass </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">[,</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">...]</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">)</span><span class="pln" style="padding: 0px; margin: 0px;">
</span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> TABLESPACE tablespace </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;">
</span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> WHERE predicate </span><span class="pun" style="padding: 0px; margin: 0px;">]</span>

CREATE LANGUAGE

定义一个新的程序语言.

<span class="pln" style="padding: 0px; margin: 0px;">CREATE </span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> TRUSTED </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> PROCEDURAL </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;"> LANGUAGE name
HANDLER call_handler </span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> VALIDATOR val_function </span><span class="pun" style="padding: 0px; margin: 0px;">]</span>

CREATE OPERATOR

定义一个新的操作.

<span class="pln" style="padding: 0px; margin: 0px;">CREATE OPERATOR name </span><span class="pun" style="padding: 0px; margin: 0px;">(</span><span class="pln" style="padding: 0px; margin: 0px;">
PROCEDURE </span><span class="pun" style="padding: 0px; margin: 0px;">=</span><span class="pln" style="padding: 0px; margin: 0px;"> func_name
</span><span class="pun" style="padding: 0px; margin: 0px;">[,</span><span class="pln" style="padding: 0px; margin: 0px;"> LEFTARG </span><span class="pun" style="padding: 0px; margin: 0px;">=</span><span class="pln" style="padding: 0px; margin: 0px;"> left_type </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">[,</span><span class="pln" style="padding: 0px; margin: 0px;"> RIGHTARG </span><span class="pun" style="padding: 0px; margin: 0px;">=</span><span class="pln" style="padding: 0px; margin: 0px;"> right_type </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;">
</span><span class="pun" style="padding: 0px; margin: 0px;">[,</span><span class="pln" style="padding: 0px; margin: 0px;"> COMMUTATOR </span><span class="pun" style="padding: 0px; margin: 0px;">=</span><span class="pln" style="padding: 0px; margin: 0px;"> com_op </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">[,</span><span class="pln" style="padding: 0px; margin: 0px;"> NEGATOR </span><span class="pun" style="padding: 0px; margin: 0px;">=</span><span class="pln" style="padding: 0px; margin: 0px;"> neg_op </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;">
</span><span class="pun" style="padding: 0px; margin: 0px;">[,</span><span class="pln" style="padding: 0px; margin: 0px;"> RESTRICT </span><span class="pun" style="padding: 0px; margin: 0px;">=</span><span class="pln" style="padding: 0px; margin: 0px;"> res_proc </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">[,</span><span class="pln" style="padding: 0px; margin: 0px;"> JOIN </span><span class="pun" style="padding: 0px; margin: 0px;">=</span><span class="pln" style="padding: 0px; margin: 0px;"> join_proc </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;">
</span><span class="pun" style="padding: 0px; margin: 0px;">[,</span><span class="pln" style="padding: 0px; margin: 0px;"> HASHES </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">[,</span><span class="pln" style="padding: 0px; margin: 0px;"> MERGES </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;">
</span><span class="pun" style="padding: 0px; margin: 0px;">[,</span><span class="pln" style="padding: 0px; margin: 0px;"> SORT1 </span><span class="pun" style="padding: 0px; margin: 0px;">=</span><span class="pln" style="padding: 0px; margin: 0px;"> left_sort_op </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">[,</span><span class="pln" style="padding: 0px; margin: 0px;"> SORT2 </span><span class="pun" style="padding: 0px; margin: 0px;">=</span><span class="pln" style="padding: 0px; margin: 0px;"> right_sort_op </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;">
</span><span class="pun" style="padding: 0px; margin: 0px;">[,</span><span class="pln" style="padding: 0px; margin: 0px;"> LTCMP </span><span class="pun" style="padding: 0px; margin: 0px;">=</span><span class="pln" style="padding: 0px; margin: 0px;"> less_than_op </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">[,</span><span class="pln" style="padding: 0px; margin: 0px;"> GTCMP </span><span class="pun" style="padding: 0px; margin: 0px;">=</span><span class="pln" style="padding: 0px; margin: 0px;"> greater_than_op </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;">
</span><span class="pun" style="padding: 0px; margin: 0px;">)</span>

CREATE OPERATOR CLASS

定义一个新的操作符类.

<span class="pln" style="padding: 0px; margin: 0px;">CREATE OPERATOR CLASS name </span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> DEFAULT </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;"> FOR TYPE data_type
USING index_method AS
</span><span class="pun" style="padding: 0px; margin: 0px;">{</span><span class="pln" style="padding: 0px; margin: 0px;"> OPERATOR strategy_number operator_name </span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">(</span><span class="pln" style="padding: 0px; margin: 0px;"> op_type</span><span class="pun" style="padding: 0px; margin: 0px;">,</span><span class="pln" style="padding: 0px; margin: 0px;"> op_type </span><span class="pun" style="padding: 0px; margin: 0px;">)</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> RECHECK </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;">
</span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;"> FUNCTION support_number func_name </span><span class="pun" style="padding: 0px; margin: 0px;">(</span><span class="pln" style="padding: 0px; margin: 0px;"> argument_type </span><span class="pun" style="padding: 0px; margin: 0px;">[,</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">...]</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">)</span><span class="pln" style="padding: 0px; margin: 0px;">
</span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;"> STORAGE storage_type
</span><span class="pun" style="padding: 0px; margin: 0px;">}</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">[,</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">...</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">]</span>

CREATE RULE

定义一个新的重写规则.

<span class="pln" style="padding: 0px; margin: 0px;">CREATE </span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> OR REPLACE </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;"> RULE name AS ON </span><span class="kwd" style="padding: 0px; margin: 0px;">event</span><span class="pln" style="padding: 0px; margin: 0px;">
TO table </span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> WHERE condition </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;">
DO </span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> ALSO </span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;"> INSTEAD </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">{</span><span class="pln" style="padding: 0px; margin: 0px;"> NOTHING </span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;"> command </span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">(</span><span class="pln" style="padding: 0px; margin: 0px;"> command </span><span class="pun" style="padding: 0px; margin: 0px;">;</span><span class="pln" style="padding: 0px; margin: 0px;"> command </span><span class="pun" style="padding: 0px; margin: 0px;">...</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">)</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">}</span>

CREATE SCHEMA

定义一个新的模式.

<span class="pln" style="padding: 0px; margin: 0px;">CREATE SCHEMA schema_name
</span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> AUTHORIZATION username </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> schema_element </span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">...</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;">
CREATE SCHEMA AUTHORIZATION username
</span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> schema_element </span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">...</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">]</span>

CREATE SEQUENCE

定义一个新的序列发生器.

<span class="pln" style="padding: 0px; margin: 0px;">CREATE </span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> TEMPORARY </span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;"> TEMP </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;"> SEQUENCE name
</span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> INCREMENT </span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> BY </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;"> increment </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;">
</span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> MINVALUE minvalue </span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;"> NO MINVALUE </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;">
</span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> MAXVALUE maxvalue </span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;"> NO MAXVALUE </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;">
</span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> START </span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> WITH </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;"> start </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> CACHE cache </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> NO </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;"> CYCLE </span><span class="pun" style="padding: 0px; margin: 0px;">]</span>

CREATE TABLE

定义一个新表.

<span class="pln" style="padding: 0px; margin: 0px;">CREATE </span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> GLOBAL </span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;"> LOCAL </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">{</span><span class="pln" style="padding: 0px; margin: 0px;"> TEMPORARY </span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;"> TEMP </span><span class="pun" style="padding: 0px; margin: 0px;">}</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;"> TABLE table_name </span><span class="pun" style="padding: 0px; margin: 0px;">(</span><span class="pln" style="padding: 0px; margin: 0px;">
</span><span class="pun" style="padding: 0px; margin: 0px;">{</span><span class="pln" style="padding: 0px; margin: 0px;"> column_name data_type </span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> DEFAULT default_expr </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> column_constraint </span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">...</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;">
</span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;"> table_constraint
</span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;"> LIKE parent_table </span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">{</span><span class="pln" style="padding: 0px; margin: 0px;"> INCLUDING </span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;"> EXCLUDING </span><span class="pun" style="padding: 0px; margin: 0px;">}</span><span class="pln" style="padding: 0px; margin: 0px;"> DEFAULTS </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">}</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">[,</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">...</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;">
</span><span class="pun" style="padding: 0px; margin: 0px;">)</span><span class="pln" style="padding: 0px; margin: 0px;">
</span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> INHERITS </span><span class="pun" style="padding: 0px; margin: 0px;">(</span><span class="pln" style="padding: 0px; margin: 0px;"> parent_table </span><span class="pun" style="padding: 0px; margin: 0px;">[,</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">...</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">)</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;">
</span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> WITH OIDS </span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;"> WITHOUT OIDS </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;">
</span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> ON COMMIT </span><span class="pun" style="padding: 0px; margin: 0px;">{</span><span class="pln" style="padding: 0px; margin: 0px;"> PRESERVE ROWS </span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;"> DELETE ROWS </span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;"> DROP </span><span class="pun" style="padding: 0px; margin: 0px;">}</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;">
</span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> TABLESPACE tablespace </span><span class="pun" style="padding: 0px; margin: 0px;">]</span>
Where column_constraint is:
<span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> CONSTRAINT constraint_name </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;">
</span><span class="pun" style="padding: 0px; margin: 0px;">{</span><span class="pln" style="padding: 0px; margin: 0px;"> NOT NULL </span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;">
NULL </span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;">
UNIQUE </span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> USING INDEX TABLESPACE tablespace </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;">
PRIMARY KEY </span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> USING INDEX TABLESPACE tablespace </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;">
CHECK </span><span class="pun" style="padding: 0px; margin: 0px;">(</span><span class="pln" style="padding: 0px; margin: 0px;">expression</span><span class="pun" style="padding: 0px; margin: 0px;">)</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;">
REFERENCES ref_table </span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">(</span><span class="pln" style="padding: 0px; margin: 0px;"> ref_column </span><span class="pun" style="padding: 0px; margin: 0px;">)</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;">
</span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> MATCH FULL </span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;"> MATCH PARTIAL </span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;"> MATCH SIMPLE </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;">
</span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> ON DELETE action </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> ON UPDATE action </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">}</span><span class="pln" style="padding: 0px; margin: 0px;">
</span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> DEFERRABLE </span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;"> NOT DEFERRABLE </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> INITIALLY DEFERRED </span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;"> INITIALLY IMMEDIATE </span><span class="pun" style="padding: 0px; margin: 0px;">]</span>

And table_constraint is:

<span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> CONSTRAINT constraint_name </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;">
</span><span class="pun" style="padding: 0px; margin: 0px;">{</span><span class="pln" style="padding: 0px; margin: 0px;"> UNIQUE </span><span class="pun" style="padding: 0px; margin: 0px;">(</span><span class="pln" style="padding: 0px; margin: 0px;"> column_name </span><span class="pun" style="padding: 0px; margin: 0px;">[,</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">...</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">)</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> USING INDEX TABLESPACE tablespace </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;">
PRIMARY KEY </span><span class="pun" style="padding: 0px; margin: 0px;">(</span><span class="pln" style="padding: 0px; margin: 0px;"> column_name </span><span class="pun" style="padding: 0px; margin: 0px;">[,</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">...</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">)</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> USING INDEX TABLESPACE tablespace </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;">
CHECK </span><span class="pun" style="padding: 0px; margin: 0px;">(</span><span class="pln" style="padding: 0px; margin: 0px;"> expression </span><span class="pun" style="padding: 0px; margin: 0px;">)</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;">
FOREIGN KEY </span><span class="pun" style="padding: 0px; margin: 0px;">(</span><span class="pln" style="padding: 0px; margin: 0px;"> column_name </span><span class="pun" style="padding: 0px; margin: 0px;">[,</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">...</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">)</span><span class="pln" style="padding: 0px; margin: 0px;">
REFERENCES ref_table </span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">(</span><span class="pln" style="padding: 0px; margin: 0px;"> ref_column </span><span class="pun" style="padding: 0px; margin: 0px;">[,</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">...</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">)</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;">
</span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> MATCH FULL </span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;"> MATCH PARTIAL </span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;"> MATCH SIMPLE </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;">
</span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> ON DELETE action </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> ON UPDATE action </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">}</span><span class="pln" style="padding: 0px; margin: 0px;">
</span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> DEFERRABLE </span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;"> NOT DEFERRABLE </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> INITIALLY DEFERRED </span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;"> INITIALLY IMMEDIATE </span><span class="pun" style="padding: 0px; margin: 0px;">]</span>


CREATE TABLE AS

定义一个新表的查询结果。

<span class="pln" style="padding: 0px; margin: 0px;">CREATE </span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> GLOBAL </span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;"> LOCAL </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">{</span><span class="pln" style="padding: 0px; margin: 0px;"> TEMPORARY </span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;"> TEMP </span><span class="pun" style="padding: 0px; margin: 0px;">}</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;"> TABLE table_name
</span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">(</span><span class="pln" style="padding: 0px; margin: 0px;">column_name </span><span class="pun" style="padding: 0px; margin: 0px;">[,</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">...]</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">)</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> WITH </span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;"> WITHOUT </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;"> OIDS </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;">
AS query</span>

CREATE TABLESPACE

定义一个新的表空间。

<span class="pln" style="padding: 0px; margin: 0px;">CREATE TABLESPACE tablespace_name </span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> OWNER username </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;"> LOCATION </span><span class="str" style="padding: 0px; margin: 0px;">'directory'</span>

CREATE TRIGGER

定义一个新的触发器。

<span class="pln" style="padding: 0px; margin: 0px;">CREATE TRIGGER name </span><span class="pun" style="padding: 0px; margin: 0px;">{</span><span class="pln" style="padding: 0px; margin: 0px;"> BEFORE </span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;"> AFTER </span><span class="pun" style="padding: 0px; margin: 0px;">}</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">{</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="kwd" style="padding: 0px; margin: 0px;">event</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> OR </span><span class="pun" style="padding: 0px; margin: 0px;">...</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">}</span><span class="pln" style="padding: 0px; margin: 0px;">
ON table </span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> FOR </span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> EACH </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">{</span><span class="pln" style="padding: 0px; margin: 0px;"> ROW </span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;"> STATEMENT </span><span class="pun" style="padding: 0px; margin: 0px;">}</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;">
EXECUTE PROCEDURE func_name </span><span class="pun" style="padding: 0px; margin: 0px;">(</span><span class="pln" style="padding: 0px; margin: 0px;"> arguments </span><span class="pun" style="padding: 0px; margin: 0px;">)</span>

CREATE TYPE

定义一个新的数据类型。

<span class="pln" style="padding: 0px; margin: 0px;">CREATE TYPE name AS
</span><span class="pun" style="padding: 0px; margin: 0px;">(</span><span class="pln" style="padding: 0px; margin: 0px;"> attribute_name data_type </span><span class="pun" style="padding: 0px; margin: 0px;">[,</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">...</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">)</span><span class="pln" style="padding: 0px; margin: 0px;">
CREATE TYPE name </span><span class="pun" style="padding: 0px; margin: 0px;">(</span><span class="pln" style="padding: 0px; margin: 0px;">
INPUT </span><span class="pun" style="padding: 0px; margin: 0px;">=</span><span class="pln" style="padding: 0px; margin: 0px;"> input_function</span><span class="pun" style="padding: 0px; margin: 0px;">,</span><span class="pln" style="padding: 0px; margin: 0px;">
OUTPUT </span><span class="pun" style="padding: 0px; margin: 0px;">=</span><span class="pln" style="padding: 0px; margin: 0px;"> output_function
</span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">,</span><span class="pln" style="padding: 0px; margin: 0px;"> RECEIVE </span><span class="pun" style="padding: 0px; margin: 0px;">=</span><span class="pln" style="padding: 0px; margin: 0px;"> receive_function </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;">
</span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">,</span><span class="pln" style="padding: 0px; margin: 0px;"> SEND </span><span class="pun" style="padding: 0px; margin: 0px;">=</span><span class="pln" style="padding: 0px; margin: 0px;"> send_function </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;">
</span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">,</span><span class="pln" style="padding: 0px; margin: 0px;"> ANALYZE </span><span class="pun" style="padding: 0px; margin: 0px;">=</span><span class="pln" style="padding: 0px; margin: 0px;"> analyze_function </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;">
</span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">,</span><span class="pln" style="padding: 0px; margin: 0px;"> INTERNALLENGTH </span><span class="pun" style="padding: 0px; margin: 0px;">=</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">{</span><span class="pln" style="padding: 0px; margin: 0px;"> internal_length </span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;"> VARIABLE </span><span class="pun" style="padding: 0px; margin: 0px;">}</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;">
</span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">,</span><span class="pln" style="padding: 0px; margin: 0px;"> PASSEDBYVALUE </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;">
</span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">,</span><span class="pln" style="padding: 0px; margin: 0px;"> ALIGNMENT </span><span class="pun" style="padding: 0px; margin: 0px;">=</span><span class="pln" style="padding: 0px; margin: 0px;"> alignment </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;">
</span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">,</span><span class="pln" style="padding: 0px; margin: 0px;"> STORAGE </span><span class="pun" style="padding: 0px; margin: 0px;">=</span><span class="pln" style="padding: 0px; margin: 0px;"> storage </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;">
</span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">,</span><span class="pln" style="padding: 0px; margin: 0px;"> DEFAULT </span><span class="pun" style="padding: 0px; margin: 0px;">=</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="kwd" style="padding: 0px; margin: 0px;">default</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;">
</span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">,</span><span class="pln" style="padding: 0px; margin: 0px;"> ELEMENT </span><span class="pun" style="padding: 0px; margin: 0px;">=</span><span class="pln" style="padding: 0px; margin: 0px;"> element </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;">
</span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">,</span><span class="pln" style="padding: 0px; margin: 0px;"> DELIMITER </span><span class="pun" style="padding: 0px; margin: 0px;">=</span><span class="pln" style="padding: 0px; margin: 0px;"> delimiter </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;">
</span><span class="pun" style="padding: 0px; margin: 0px;">)</span>

CREATE USER

定义一个新的数据库用户帐户。

<span class="pln" style="padding: 0px; margin: 0px;">CREATE USER name </span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> WITH </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;"> option </span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">...</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">]</span>

选项​​可以是:

<span class="pln" style="padding: 0px; margin: 0px;">SYSID uid
</span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> ENCRYPTED </span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;"> UNENCRYPTED </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;"> PASSWORD </span><span class="str" style="padding: 0px; margin: 0px;">'password'</span><span class="pln" style="padding: 0px; margin: 0px;">
</span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;"> CREATEDB </span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;"> NOCREATEDB
</span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;"> CREATEUSER </span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;"> NOCREATEUSER
</span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;"> IN GROUP group_name </span><span class="pun" style="padding: 0px; margin: 0px;">[,</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">...]</span><span class="pln" style="padding: 0px; margin: 0px;">
</span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;"> VALID UNTIL </span><span class="str" style="padding: 0px; margin: 0px;">'abs_time'</span>

CREATE VIEW

定义一个新的视图。

<span class="pln" style="padding: 0px; margin: 0px;">CREATE </span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> OR REPLACE </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;"> VIEW name </span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">(</span><span class="pln" style="padding: 0px; margin: 0px;"> column_name </span><span class="pun" style="padding: 0px; margin: 0px;">[,</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">...]</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">)</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;"> AS query</span>

DEALLOCATE

释放一份事先准备好的声明。

<span class="pln" style="padding: 0px; margin: 0px;">DEALLOCATE </span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> PREPARE </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;"> plan_name</span>

DECLARE

定义一个游标。

<span class="pln" style="padding: 0px; margin: 0px;">DECLARE name </span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> BINARY </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> INSENSITIVE </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> NO </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;"> SCROLL </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;">
CURSOR </span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">{</span><span class="pln" style="padding: 0px; margin: 0px;"> WITH </span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;"> WITHOUT </span><span class="pun" style="padding: 0px; margin: 0px;">}</span><span class="pln" style="padding: 0px; margin: 0px;"> HOLD </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;"> FOR query
</span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> FOR </span><span class="pun" style="padding: 0px; margin: 0px;">{</span><span class="pln" style="padding: 0px; margin: 0px;"> READ ONLY </span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;"> UPDATE </span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> OF column </span><span class="pun" style="padding: 0px; margin: 0px;">[,</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">...]</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">}</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">]</span>

DELETE

删除一个表中的行。

<span class="pln" style="padding: 0px; margin: 0px;">DELETE FROM </span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> ONLY </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;"> table </span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> WHERE condition </span><span class="pun" style="padding: 0px; margin: 0px;">]</span>

DROP AGGREGATE

Remove an aggregate function.

<span class="pln" style="padding: 0px; margin: 0px;">DROP AGGREGATE name </span><span class="pun" style="padding: 0px; margin: 0px;">(</span><span class="pln" style="padding: 0px; margin: 0px;"> type </span><span class="pun" style="padding: 0px; margin: 0px;">)</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> CASCADE </span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;"> RESTRICT </span><span class="pun" style="padding: 0px; margin: 0px;">]</span>

DROP CAST

移除一个转换。

<span class="pln" style="padding: 0px; margin: 0px;">DROP CAST </span><span class="pun" style="padding: 0px; margin: 0px;">(</span><span class="pln" style="padding: 0px; margin: 0px;">source_type AS target_type</span><span class="pun" style="padding: 0px; margin: 0px;">)</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> CASCADE </span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;"> RESTRICT </span><span class="pun" style="padding: 0px; margin: 0px;">]</span>

DROP CONVERSION

取下转换。

<span class="pln" style="padding: 0px; margin: 0px;">DROP CONVERSION name </span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> CASCADE </span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;"> RESTRICT </span><span class="pun" style="padding: 0px; margin: 0px;">]</span>

DROP DATABASE

删除一个数据库。

<span class="pln" style="padding: 0px; margin: 0px;">DROP DATABASE name</span>

DROP DOMAIN

删除域。

<span class="pln" style="padding: 0px; margin: 0px;">DROP DOMAIN name </span><span class="pun" style="padding: 0px; margin: 0px;">[,</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">...]</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> CASCADE </span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;"> RESTRICT </span><span class="pun" style="padding: 0px; margin: 0px;">]</span>

DROP FUNCTION

删除功能(函数)。

<span class="pln" style="padding: 0px; margin: 0px;">DROP FUNCTION name </span><span class="pun" style="padding: 0px; margin: 0px;">(</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> type </span><span class="pun" style="padding: 0px; margin: 0px;">[,</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">...]</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">)</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> CASCADE </span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;"> RESTRICT </span><span class="pun" style="padding: 0px; margin: 0px;">]</span>

DROP GROUP

删除用户组。

<span class="pln" style="padding: 0px; margin: 0px;">DROP GROUP name</span>

DROP INDEX

Remove an index.

<span class="pln" style="padding: 0px; margin: 0px;">DROP INDEX name </span><span class="pun" style="padding: 0px; margin: 0px;">[,</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">...]</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> CASCADE </span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;"> RESTRICT </span><span class="pun" style="padding: 0px; margin: 0px;">]</span>

DROP LANGUAGE

Remove a procedural language.

<span class="pln" style="padding: 0px; margin: 0px;">DROP </span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> PROCEDURAL </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;"> LANGUAGE name </span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> CASCADE </span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;"> RESTRICT </span><span class="pun" style="padding: 0px; margin: 0px;">]</span>

DROP OPERATOR

Remove an operator.

<span class="pln" style="padding: 0px; margin: 0px;">DROP OPERATOR name </span><span class="pun" style="padding: 0px; margin: 0px;">(</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">{</span><span class="pln" style="padding: 0px; margin: 0px;"> left_type </span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;"> NONE </span><span class="pun" style="padding: 0px; margin: 0px;">}</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">,</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">{</span><span class="pln" style="padding: 0px; margin: 0px;"> right_type </span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;"> NONE </span><span class="pun" style="padding: 0px; margin: 0px;">}</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">)</span><span class="pln" style="padding: 0px; margin: 0px;">
</span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> CASCADE </span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;"> RESTRICT </span><span class="pun" style="padding: 0px; margin: 0px;">]</span>

DROP OPERATOR CLASS

Remove an operator class.

<span class="pln" style="padding: 0px; margin: 0px;">DROP OPERATOR CLASS name USING index_method </span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> CASCADE </span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;"> RESTRICT </span><span class="pun" style="padding: 0px; margin: 0px;">]</span>

DROP RULE

Remove a rewrite rule.

<span class="pln" style="padding: 0px; margin: 0px;">DROP RULE name ON relation </span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> CASCADE </span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;"> RESTRICT </span><span class="pun" style="padding: 0px; margin: 0px;">]</span>

DROP SCHEMA

Remove a schema.

<span class="pln" style="padding: 0px; margin: 0px;">DROP SCHEMA name </span><span class="pun" style="padding: 0px; margin: 0px;">[,</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">...]</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> CASCADE </span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;"> RESTRICT </span><span class="pun" style="padding: 0px; margin: 0px;">]</span>

DROP SEQUENCE

Remove a sequence.

<span class="pln" style="padding: 0px; margin: 0px;">DROP SEQUENCE name </span><span class="pun" style="padding: 0px; margin: 0px;">[,</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">...]</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> CASCADE </span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;"> RESTRICT </span><span class="pun" style="padding: 0px; margin: 0px;">]</span>

DROP TABLE

Remove a table.

<span class="pln" style="padding: 0px; margin: 0px;">DROP TABLE name </span><span class="pun" style="padding: 0px; margin: 0px;">[,</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">...]</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> CASCADE </span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;"> RESTRICT </span><span class="pun" style="padding: 0px; margin: 0px;">]</span>

DROP TABLESPACE

Remove a tablespace.

<span class="pln" style="padding: 0px; margin: 0px;">DROP TABLESPACE tablespace_name</span>

DROP TRIGGER

Remove a trigger.

<span class="pln" style="padding: 0px; margin: 0px;">DROP TRIGGER name ON table </span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> CASCADE </span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;"> RESTRICT </span><span class="pun" style="padding: 0px; margin: 0px;">]</span>

DROP TYPE

Remove a data type.

<span class="pln" style="padding: 0px; margin: 0px;">DROP TYPE name </span><span class="pun" style="padding: 0px; margin: 0px;">[,</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">...]</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> CASCADE </span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;"> RESTRICT </span><span class="pun" style="padding: 0px; margin: 0px;">]</span>

DROP USER

Remove a database user account.

<span class="pln" style="padding: 0px; margin: 0px;">DROP USER name</span>

DROP VIEW

Remove a view.

<span class="pln" style="padding: 0px; margin: 0px;">DROP VIEW name </span><span class="pun" style="padding: 0px; margin: 0px;">[,</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">...]</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> CASCADE </span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;"> RESTRICT </span><span class="pun" style="padding: 0px; margin: 0px;">]</span>

END

Commit the current transaction.

<span class="kwd" style="padding: 0px; margin: 0px;">END</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> WORK </span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;"> TRANSACTION </span><span class="pun" style="padding: 0px; margin: 0px;">]</span>

EXECUTE

Execute a prepared statement.

<span class="pln" style="padding: 0px; margin: 0px;">EXECUTE plan_name </span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">(</span><span class="pln" style="padding: 0px; margin: 0px;">parameter </span><span class="pun" style="padding: 0px; margin: 0px;">[,</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">...]</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">)</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">]</span>

EXPLAIN

Show the execution plan of a statement.

<span class="pln" style="padding: 0px; margin: 0px;">EXPLAIN </span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> ANALYZE </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> VERBOSE </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;"> statement</span>

FETCH

Retrieve rows from a query using a cursor.

<span class="pln" style="padding: 0px; margin: 0px;">FETCH </span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> direction </span><span class="pun" style="padding: 0px; margin: 0px;">{</span><span class="pln" style="padding: 0px; margin: 0px;"> FROM </span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;"> IN </span><span class="pun" style="padding: 0px; margin: 0px;">}</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;"> cursor_name</span>

Where direction can be empty or one of:

<span class="pln" style="padding: 0px; margin: 0px;">NEXT
PRIOR
FIRST
LAST
ABSOLUTE count
RELATIVE count
count
ALL
FORWARD
FORWARD count
FORWARD ALL
BACKWARD
BACKWARD count
BACKWARD ALL</span>

GRANT

Define access privileges.

<span class="pln" style="padding: 0px; margin: 0px;">GRANT </span><span class="pun" style="padding: 0px; margin: 0px;">{</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">{</span><span class="pln" style="padding: 0px; margin: 0px;"> SELECT </span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;"> INSERT </span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;"> UPDATE </span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;"> DELETE </span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;"> RULE </span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;"> REFERENCES </span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;"> TRIGGER </span><span class="pun" style="padding: 0px; margin: 0px;">}</span><span class="pln" style="padding: 0px; margin: 0px;">
</span><span class="pun" style="padding: 0px; margin: 0px;">[,...]</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;"> ALL </span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> PRIVILEGES </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">}</span><span class="pln" style="padding: 0px; margin: 0px;">
ON </span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> TABLE </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;"> table_name </span><span class="pun" style="padding: 0px; margin: 0px;">[,</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">...]</span><span class="pln" style="padding: 0px; margin: 0px;">
TO </span><span class="pun" style="padding: 0px; margin: 0px;">{</span><span class="pln" style="padding: 0px; margin: 0px;"> username </span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;"> GROUP group_name </span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;"> PUBLIC </span><span class="pun" style="padding: 0px; margin: 0px;">}</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">[,</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">...]</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> WITH GRANT OPTION </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;">

GRANT </span><span class="pun" style="padding: 0px; margin: 0px;">{</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">{</span><span class="pln" style="padding: 0px; margin: 0px;"> CREATE </span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;"> TEMPORARY </span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;"> TEMP </span><span class="pun" style="padding: 0px; margin: 0px;">}</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">[,...]</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;"> ALL </span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> PRIVILEGES </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">}</span><span class="pln" style="padding: 0px; margin: 0px;">
ON DATABASE db_name </span><span class="pun" style="padding: 0px; margin: 0px;">[,</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">...]</span><span class="pln" style="padding: 0px; margin: 0px;">
TO </span><span class="pun" style="padding: 0px; margin: 0px;">{</span><span class="pln" style="padding: 0px; margin: 0px;"> username </span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;"> GROUP group_name </span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;"> PUBLIC </span><span class="pun" style="padding: 0px; margin: 0px;">}</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">[,</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">...]</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> WITH GRANT OPTION </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;">

GRANT </span><span class="pun" style="padding: 0px; margin: 0px;">{</span><span class="pln" style="padding: 0px; margin: 0px;"> CREATE </span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;"> ALL </span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> PRIVILEGES </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">}</span><span class="pln" style="padding: 0px; margin: 0px;">
ON TABLESPACE tablespace_name </span><span class="pun" style="padding: 0px; margin: 0px;">[,</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">...]</span><span class="pln" style="padding: 0px; margin: 0px;">
TO </span><span class="pun" style="padding: 0px; margin: 0px;">{</span><span class="pln" style="padding: 0px; margin: 0px;"> username </span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;"> GROUP group_name </span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;"> PUBLIC </span><span class="pun" style="padding: 0px; margin: 0px;">}</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">[,</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">...]</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> WITH GRANT OPTION </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;">

GRANT </span><span class="pun" style="padding: 0px; margin: 0px;">{</span><span class="pln" style="padding: 0px; margin: 0px;"> EXECUTE </span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;"> ALL </span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> PRIVILEGES </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">}</span><span class="pln" style="padding: 0px; margin: 0px;">
ON FUNCTION func_name </span><span class="pun" style="padding: 0px; margin: 0px;">([</span><span class="pln" style="padding: 0px; margin: 0px;">type</span><span class="pun" style="padding: 0px; margin: 0px;">,</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">...])</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">[,</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">...]</span><span class="pln" style="padding: 0px; margin: 0px;">
TO </span><span class="pun" style="padding: 0px; margin: 0px;">{</span><span class="pln" style="padding: 0px; margin: 0px;"> username </span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;"> GROUP group_name </span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;"> PUBLIC </span><span class="pun" style="padding: 0px; margin: 0px;">}</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">[,</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">...]</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> WITH GRANT OPTION </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;">

GRANT </span><span class="pun" style="padding: 0px; margin: 0px;">{</span><span class="pln" style="padding: 0px; margin: 0px;"> USAGE </span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;"> ALL </span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> PRIVILEGES </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">}</span><span class="pln" style="padding: 0px; margin: 0px;">
ON LANGUAGE lang_name </span><span class="pun" style="padding: 0px; margin: 0px;">[,</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">...]</span><span class="pln" style="padding: 0px; margin: 0px;">
TO </span><span class="pun" style="padding: 0px; margin: 0px;">{</span><span class="pln" style="padding: 0px; margin: 0px;"> username </span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;"> GROUP group_name </span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;"> PUBLIC </span><span class="pun" style="padding: 0px; margin: 0px;">}</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">[,</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">...]</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> WITH GRANT OPTION </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;">

GRANT </span><span class="pun" style="padding: 0px; margin: 0px;">{</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">{</span><span class="pln" style="padding: 0px; margin: 0px;"> CREATE </span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;"> USAGE </span><span class="pun" style="padding: 0px; margin: 0px;">}</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">[,...]</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;"> ALL </span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> PRIVILEGES </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">}</span><span class="pln" style="padding: 0px; margin: 0px;">
ON SCHEMA schema_name </span><span class="pun" style="padding: 0px; margin: 0px;">[,</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">...]</span><span class="pln" style="padding: 0px; margin: 0px;">
TO </span><span class="pun" style="padding: 0px; margin: 0px;">{</span><span class="pln" style="padding: 0px; margin: 0px;"> username </span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;"> GROUP group_name </span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;"> PUBLIC </span><span class="pun" style="padding: 0px; margin: 0px;">}</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">[,</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">...]</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> WITH GRANT OPTION </span><span class="pun" style="padding: 0px; margin: 0px;">]</span>

INSERT

Create new rows in a table.

<span class="pln" style="padding: 0px; margin: 0px;">INSERT INTO table </span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">(</span><span class="pln" style="padding: 0px; margin: 0px;"> column </span><span class="pun" style="padding: 0px; margin: 0px;">[,</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">...]</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">)</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;">
</span><span class="pun" style="padding: 0px; margin: 0px;">{</span><span class="pln" style="padding: 0px; margin: 0px;"> DEFAULT VALUES </span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;"> VALUES </span><span class="pun" style="padding: 0px; margin: 0px;">(</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">{</span><span class="pln" style="padding: 0px; margin: 0px;"> expression </span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;"> DEFAULT </span><span class="pun" style="padding: 0px; margin: 0px;">}</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">[,</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">...]</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">)</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;"> query </span><span class="pun" style="padding: 0px; margin: 0px;">}</span>

LISTEN

Listen for a notification.

<span class="pln" style="padding: 0px; margin: 0px;">LISTEN name</span>

LOAD

Load or reload a shared library file.

<span class="pln" style="padding: 0px; margin: 0px;">LOAD </span><span class="str" style="padding: 0px; margin: 0px;">'filename'</span>

LOCK

Lock a table.

<span class="pln" style="padding: 0px; margin: 0px;">LOCK </span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> TABLE </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;"> name </span><span class="pun" style="padding: 0px; margin: 0px;">[,</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">...]</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> IN lock_mode MODE </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> NOWAIT </span><span class="pun" style="padding: 0px; margin: 0px;">]</span>

Where lock_mode is one of:

<span class="pln" style="padding: 0px; margin: 0px;">ACCESS SHARE </span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;"> ROW SHARE </span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;"> ROW EXCLUSIVE </span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;"> SHARE UPDATE EXCLUSIVE
</span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;"> SHARE </span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;"> SHARE ROW EXCLUSIVE </span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;"> EXCLUSIVE </span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;"> ACCESS EXCLUSIVE</span>

MOVE

Position a cursor.

<span class="pln" style="padding: 0px; margin: 0px;">MOVE </span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> direction </span><span class="pun" style="padding: 0px; margin: 0px;">{</span><span class="pln" style="padding: 0px; margin: 0px;"> FROM </span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;"> IN </span><span class="pun" style="padding: 0px; margin: 0px;">}</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;"> cursor_name</span>

NOTIFY

Generate a notification.

<span class="pln" style="padding: 0px; margin: 0px;">NOTIFY name</span>

PREPARE

Prepare a statement for execution.

<span class="pln" style="padding: 0px; margin: 0px;">PREPARE plan_name </span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">(</span><span class="pln" style="padding: 0px; margin: 0px;">data_type </span><span class="pun" style="padding: 0px; margin: 0px;">[,</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">...]</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">)</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;"> AS statement</span>

REINDEX

Rebuild indexes.

<span class="pln" style="padding: 0px; margin: 0px;">REINDEX </span><span class="pun" style="padding: 0px; margin: 0px;">{</span><span class="pln" style="padding: 0px; margin: 0px;"> DATABASE </span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;"> TABLE </span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;"> INDEX </span><span class="pun" style="padding: 0px; margin: 0px;">}</span><span class="pln" style="padding: 0px; margin: 0px;"> name </span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> FORCE </span><span class="pun" style="padding: 0px; margin: 0px;">]</span>

RELEASE SAVEPOINT

Destroy a previously defined savepoint.

<span class="pln" style="padding: 0px; margin: 0px;">RELEASE </span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> SAVEPOINT </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;"> savepoint_name</span>

RESET

Restore the value of a runtime parameter to the default value.

<span class="pln" style="padding: 0px; margin: 0px;">RESET name
RESET ALL</span>

REVOKE

Remove access privileges.

<span class="pln" style="padding: 0px; margin: 0px;">REVOKE </span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> GRANT OPTION FOR </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;">
</span><span class="pun" style="padding: 0px; margin: 0px;">{</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">{</span><span class="pln" style="padding: 0px; margin: 0px;"> SELECT </span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;"> INSERT </span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;"> UPDATE </span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;"> DELETE </span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;"> RULE </span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;"> REFERENCES </span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;"> TRIGGER </span><span class="pun" style="padding: 0px; margin: 0px;">}</span><span class="pln" style="padding: 0px; margin: 0px;">
</span><span class="pun" style="padding: 0px; margin: 0px;">[,...]</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;"> ALL </span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> PRIVILEGES </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">}</span><span class="pln" style="padding: 0px; margin: 0px;">
ON </span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> TABLE </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;"> table_name </span><span class="pun" style="padding: 0px; margin: 0px;">[,</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">...]</span><span class="pln" style="padding: 0px; margin: 0px;">
FROM </span><span class="pun" style="padding: 0px; margin: 0px;">{</span><span class="pln" style="padding: 0px; margin: 0px;"> username </span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;"> GROUP group_name </span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;"> PUBLIC </span><span class="pun" style="padding: 0px; margin: 0px;">}</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">[,</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">...]</span><span class="pln" style="padding: 0px; margin: 0px;">
</span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> CASCADE </span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;"> RESTRICT </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;">

REVOKE </span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> GRANT OPTION FOR </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;">
</span><span class="pun" style="padding: 0px; margin: 0px;">{</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">{</span><span class="pln" style="padding: 0px; margin: 0px;"> CREATE </span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;"> TEMPORARY </span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;"> TEMP </span><span class="pun" style="padding: 0px; margin: 0px;">}</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">[,...]</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;"> ALL </span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> PRIVILEGES </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">}</span><span class="pln" style="padding: 0px; margin: 0px;">
ON DATABASE db_name </span><span class="pun" style="padding: 0px; margin: 0px;">[,</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">...]</span><span class="pln" style="padding: 0px; margin: 0px;">
FROM </span><span class="pun" style="padding: 0px; margin: 0px;">{</span><span class="pln" style="padding: 0px; margin: 0px;"> username </span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;"> GROUP group_name </span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;"> PUBLIC </span><span class="pun" style="padding: 0px; margin: 0px;">}</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">[,</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">...]</span><span class="pln" style="padding: 0px; margin: 0px;">
</span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> CASCADE </span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;"> RESTRICT </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;">

REVOKE </span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> GRANT OPTION FOR </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;">
</span><span class="pun" style="padding: 0px; margin: 0px;">{</span><span class="pln" style="padding: 0px; margin: 0px;"> CREATE </span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;"> ALL </span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> PRIVILEGES </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">}</span><span class="pln" style="padding: 0px; margin: 0px;">
ON TABLESPACE tablespace_name </span><span class="pun" style="padding: 0px; margin: 0px;">[,</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">...]</span><span class="pln" style="padding: 0px; margin: 0px;">
FROM </span><span class="pun" style="padding: 0px; margin: 0px;">{</span><span class="pln" style="padding: 0px; margin: 0px;"> username </span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;"> GROUP group_name </span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;"> PUBLIC </span><span class="pun" style="padding: 0px; margin: 0px;">}</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">[,</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">...]</span><span class="pln" style="padding: 0px; margin: 0px;">
</span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> CASCADE </span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;"> RESTRICT </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;">

REVOKE </span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> GRANT OPTION FOR </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;">
</span><span class="pun" style="padding: 0px; margin: 0px;">{</span><span class="pln" style="padding: 0px; margin: 0px;"> EXECUTE </span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;"> ALL </span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> PRIVILEGES </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">}</span><span class="pln" style="padding: 0px; margin: 0px;">
ON FUNCTION func_name </span><span class="pun" style="padding: 0px; margin: 0px;">([</span><span class="pln" style="padding: 0px; margin: 0px;">type</span><span class="pun" style="padding: 0px; margin: 0px;">,</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">...])</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">[,</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">...]</span><span class="pln" style="padding: 0px; margin: 0px;">
FROM </span><span class="pun" style="padding: 0px; margin: 0px;">{</span><span class="pln" style="padding: 0px; margin: 0px;"> username </span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;"> GROUP group_name </span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;"> PUBLIC </span><span class="pun" style="padding: 0px; margin: 0px;">}</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">[,</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">...]</span><span class="pln" style="padding: 0px; margin: 0px;">
</span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> CASCADE </span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;"> RESTRICT </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;">

REVOKE </span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> GRANT OPTION FOR </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;">
</span><span class="pun" style="padding: 0px; margin: 0px;">{</span><span class="pln" style="padding: 0px; margin: 0px;"> USAGE </span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;"> ALL </span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> PRIVILEGES </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">}</span><span class="pln" style="padding: 0px; margin: 0px;">
ON LANGUAGE lang_name </span><span class="pun" style="padding: 0px; margin: 0px;">[,</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">...]</span><span class="pln" style="padding: 0px; margin: 0px;">
FROM </span><span class="pun" style="padding: 0px; margin: 0px;">{</span><span class="pln" style="padding: 0px; margin: 0px;"> username </span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;"> GROUP group_name </span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;"> PUBLIC </span><span class="pun" style="padding: 0px; margin: 0px;">}</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">[,</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">...]</span><span class="pln" style="padding: 0px; margin: 0px;">
</span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> CASCADE </span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;"> RESTRICT </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;">

REVOKE </span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> GRANT OPTION FOR </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;">
</span><span class="pun" style="padding: 0px; margin: 0px;">{</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">{</span><span class="pln" style="padding: 0px; margin: 0px;"> CREATE </span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;"> USAGE </span><span class="pun" style="padding: 0px; margin: 0px;">}</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">[,...]</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;"> ALL </span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> PRIVILEGES </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">}</span><span class="pln" style="padding: 0px; margin: 0px;">
ON SCHEMA schema_name </span><span class="pun" style="padding: 0px; margin: 0px;">[,</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">...]</span><span class="pln" style="padding: 0px; margin: 0px;">
FROM </span><span class="pun" style="padding: 0px; margin: 0px;">{</span><span class="pln" style="padding: 0px; margin: 0px;"> username </span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;"> GROUP group_name </span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;"> PUBLIC </span><span class="pun" style="padding: 0px; margin: 0px;">}</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">[,</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">...]</span><span class="pln" style="padding: 0px; margin: 0px;">
</span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> CASCADE </span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;"> RESTRICT </span><span class="pun" style="padding: 0px; margin: 0px;">]</span>

ROLLBACK

Abort the current transaction.

<span class="pln" style="padding: 0px; margin: 0px;">ROLLBACK </span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> WORK </span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;"> TRANSACTION </span><span class="pun" style="padding: 0px; margin: 0px;">]</span>

ROLLBACK TO SAVEPOINT

Roll back to a savepoint.

<span class="pln" style="padding: 0px; margin: 0px;">ROLLBACK </span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> WORK </span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;"> TRANSACTION </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;"> TO </span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> SAVEPOINT </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;"> savepoint_name</span>

SAVEPOINT

Define a new savepoint within the current transaction.

<span class="pln" style="padding: 0px; margin: 0px;">SAVEPOINT savepoint_name</span>

SELECT

Retrieve rows from a table or view.

<span class="pln" style="padding: 0px; margin: 0px;">SELECT </span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> ALL </span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;"> DISTINCT </span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> ON </span><span class="pun" style="padding: 0px; margin: 0px;">(</span><span class="pln" style="padding: 0px; margin: 0px;"> expression </span><span class="pun" style="padding: 0px; margin: 0px;">[,</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">...]</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">)</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;">
</span><span class="pun" style="padding: 0px; margin: 0px;">*</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;"> expression </span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> AS output_name </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">[,</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">...]</span><span class="pln" style="padding: 0px; margin: 0px;">
</span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> FROM from_item </span><span class="pun" style="padding: 0px; margin: 0px;">[,</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">...]</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;">
</span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> WHERE condition </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;">
</span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> GROUP BY expression </span><span class="pun" style="padding: 0px; margin: 0px;">[,</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">...]</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;">
</span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> HAVING condition </span><span class="pun" style="padding: 0px; margin: 0px;">[,</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">...]</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;">
</span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">{</span><span class="pln" style="padding: 0px; margin: 0px;"> UNION </span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;"> INTERSECT </span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;"> EXCEPT </span><span class="pun" style="padding: 0px; margin: 0px;">}</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> ALL </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="kwd" style="padding: 0px; margin: 0px;">select</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;">
</span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> ORDER BY expression </span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> ASC </span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;"> DESC </span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;"> USING </span><span class="kwd" style="padding: 0px; margin: 0px;">operator</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">[,</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">...]</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;">
</span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> LIMIT </span><span class="pun" style="padding: 0px; margin: 0px;">{</span><span class="pln" style="padding: 0px; margin: 0px;"> count </span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;"> ALL </span><span class="pun" style="padding: 0px; margin: 0px;">}</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;">
</span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> OFFSET start </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;">
</span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> FOR UPDATE </span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> OF table_name </span><span class="pun" style="padding: 0px; margin: 0px;">[,</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">...]</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">]</span>
Where from_item can be one of:
<span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> ONLY </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;"> table_name </span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">*</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> AS </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="kwd" style="padding: 0px; margin: 0px;">alias</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">(</span><span class="pln" style="padding: 0px; margin: 0px;"> column_alias </span><span class="pun" style="padding: 0px; margin: 0px;">[,</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">...]</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">)</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;">
</span><span class="pun" style="padding: 0px; margin: 0px;">(</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="kwd" style="padding: 0px; margin: 0px;">select</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">)</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> AS </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="kwd" style="padding: 0px; margin: 0px;">alias</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">(</span><span class="pln" style="padding: 0px; margin: 0px;"> column_alias </span><span class="pun" style="padding: 0px; margin: 0px;">[,</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">...]</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">)</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;">
function_name </span><span class="pun" style="padding: 0px; margin: 0px;">(</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> argument </span><span class="pun" style="padding: 0px; margin: 0px;">[,</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">...]</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">)</span><span class="pln" style="padding: 0px; margin: 0px;">
</span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> AS </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="kwd" style="padding: 0px; margin: 0px;">alias</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">(</span><span class="pln" style="padding: 0px; margin: 0px;"> column_alias </span><span class="pun" style="padding: 0px; margin: 0px;">[,</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">...]</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;"> column_definition </span><span class="pun" style="padding: 0px; margin: 0px;">[,</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">...]</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">)</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;">
function_name </span><span class="pun" style="padding: 0px; margin: 0px;">(</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> argument </span><span class="pun" style="padding: 0px; margin: 0px;">[,</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">...]</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">)</span><span class="pln" style="padding: 0px; margin: 0px;"> AS </span><span class="pun" style="padding: 0px; margin: 0px;">(</span><span class="pln" style="padding: 0px; margin: 0px;"> column_definition </span><span class="pun" style="padding: 0px; margin: 0px;">[,</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">...]</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">)</span><span class="pln" style="padding: 0px; margin: 0px;">
from_item </span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> NATURAL </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;"> join_type from_item
</span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> ON join_condition </span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;"> USING </span><span class="pun" style="padding: 0px; margin: 0px;">(</span><span class="pln" style="padding: 0px; margin: 0px;"> join_column </span><span class="pun" style="padding: 0px; margin: 0px;">[,</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">...]</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">)</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">]</span>

SELECT INTO

Define a new table from the results of a query.

<span class="pln" style="padding: 0px; margin: 0px;">SELECT </span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> ALL </span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;"> DISTINCT </span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> ON </span><span class="pun" style="padding: 0px; margin: 0px;">(</span><span class="pln" style="padding: 0px; margin: 0px;"> expression </span><span class="pun" style="padding: 0px; margin: 0px;">[,</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">...]</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">)</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;">
</span><span class="pun" style="padding: 0px; margin: 0px;">*</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;"> expression </span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> AS output_name </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">[,</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">...]</span><span class="pln" style="padding: 0px; margin: 0px;">
INTO </span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> TEMPORARY </span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;"> TEMP </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> TABLE </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;"> new_table
</span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> FROM from_item </span><span class="pun" style="padding: 0px; margin: 0px;">[,</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">...]</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;">
</span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> WHERE condition </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;">
</span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> GROUP BY expression </span><span class="pun" style="padding: 0px; margin: 0px;">[,</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">...]</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;">
</span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> HAVING condition </span><span class="pun" style="padding: 0px; margin: 0px;">[,</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">...]</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;">
</span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">{</span><span class="pln" style="padding: 0px; margin: 0px;"> UNION </span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;"> INTERSECT </span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;"> EXCEPT </span><span class="pun" style="padding: 0px; margin: 0px;">}</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> ALL </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="kwd" style="padding: 0px; margin: 0px;">select</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;">
</span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> ORDER BY expression </span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> ASC </span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;"> DESC </span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;"> USING </span><span class="kwd" style="padding: 0px; margin: 0px;">operator</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">[,</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">...]</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;">
</span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> LIMIT </span><span class="pun" style="padding: 0px; margin: 0px;">{</span><span class="pln" style="padding: 0px; margin: 0px;"> count </span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;"> ALL </span><span class="pun" style="padding: 0px; margin: 0px;">}</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;">
</span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> OFFSET start </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;">
</span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> FOR UPDATE </span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> OF table_name </span><span class="pun" style="padding: 0px; margin: 0px;">[,</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">...]</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">]</span>

SET

Change a runtime parameter.

<span class="pln" style="padding: 0px; margin: 0px;">SET </span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> SESSION </span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;"> LOCAL </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;"> name </span><span class="pun" style="padding: 0px; margin: 0px;">{</span><span class="pln" style="padding: 0px; margin: 0px;"> TO </span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">=</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">}</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">{</span><span class="pln" style="padding: 0px; margin: 0px;"> value </span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="str" style="padding: 0px; margin: 0px;">'value'</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;"> DEFAULT </span><span class="pun" style="padding: 0px; margin: 0px;">}</span><span class="pln" style="padding: 0px; margin: 0px;">
SET </span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> SESSION </span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;"> LOCAL </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;"> TIME ZONE </span><span class="pun" style="padding: 0px; margin: 0px;">{</span><span class="pln" style="padding: 0px; margin: 0px;"> time_zone </span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;"> LOCAL </span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;"> DEFAULT </span><span class="pun" style="padding: 0px; margin: 0px;">}</span>

SET CONSTRAINTS

Set constraint checking modes for the current transaction.

<span class="pln" style="padding: 0px; margin: 0px;">SET CONSTRAINTS </span><span class="pun" style="padding: 0px; margin: 0px;">{</span><span class="pln" style="padding: 0px; margin: 0px;"> ALL </span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;"> name </span><span class="pun" style="padding: 0px; margin: 0px;">[,</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">...]</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">}</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">{</span><span class="pln" style="padding: 0px; margin: 0px;"> DEFERRED </span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;"> IMMEDIATE </span><span class="pun" style="padding: 0px; margin: 0px;">}</span>

SET SESSION AUTHORIZATION

Set the session user identifier and the current user identifier of the current session.

<span class="pln" style="padding: 0px; margin: 0px;">SET </span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> SESSION </span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;"> LOCAL </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;"> SESSION AUTHORIZATION username
SET </span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> SESSION </span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;"> LOCAL </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;"> SESSION AUTHORIZATION DEFAULT
RESET SESSION AUTHORIZATION</span>

SET TRANSACTION

Set the characteristics of the current transaction.

<span class="pln" style="padding: 0px; margin: 0px;">SET TRANSACTION transaction_mode </span><span class="pun" style="padding: 0px; margin: 0px;">[,</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">...]</span><span class="pln" style="padding: 0px; margin: 0px;">
SET SESSION CHARACTERISTICS AS TRANSACTION transaction_mode </span><span class="pun" style="padding: 0px; margin: 0px;">[,</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">...]</span>

Where transaction_mode is one of:

<span class="pln" style="padding: 0px; margin: 0px;">ISOLATION LEVEL </span><span class="pun" style="padding: 0px; margin: 0px;">{</span><span class="pln" style="padding: 0px; margin: 0px;"> SERIALIZABLE </span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;"> REPEATABLE READ </span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;"> READ COMMITTED
</span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;"> READ UNCOMMITTED </span><span class="pun" style="padding: 0px; margin: 0px;">}</span><span class="pln" style="padding: 0px; margin: 0px;">
READ WRITE </span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;"> READ ONLY</span>

SHOW

显示运行参数的值.

<span class="pln" style="padding: 0px; margin: 0px;">SHOW name
SHOW ALL</span>

START TRANSACTION

开始一个事务块.

<span class="pln" style="padding: 0px; margin: 0px;">START TRANSACTION </span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> transaction_mode </span><span class="pun" style="padding: 0px; margin: 0px;">[,</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">...]</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">]</span>

transaction_mode是其中一个:

<span class="pln" style="padding: 0px; margin: 0px;">ISOLATION LEVEL </span><span class="pun" style="padding: 0px; margin: 0px;">{</span><span class="pln" style="padding: 0px; margin: 0px;"> SERIALIZABLE </span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;"> REPEATABLE READ </span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;"> READ COMMITTED
</span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;"> READ UNCOMMITTED </span><span class="pun" style="padding: 0px; margin: 0px;">}</span><span class="pln" style="padding: 0px; margin: 0px;">
READ WRITE </span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;"> READ ONLY</span>

TRUNCATE

清空一个表.

<span class="pln" style="padding: 0px; margin: 0px;">TRUNCATE </span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> TABLE </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;"> name</span>

UNLISTEN

停止监听通知.

<span class="pln" style="padding: 0px; margin: 0px;">UNLISTEN </span><span class="pun" style="padding: 0px; margin: 0px;">{</span><span class="pln" style="padding: 0px; margin: 0px;"> name </span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">*</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">}</span>

UPDATE

更新表行.

<span class="pln" style="padding: 0px; margin: 0px;">UPDATE </span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> ONLY </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;"> table SET column </span><span class="pun" style="padding: 0px; margin: 0px;">=</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">{</span><span class="pln" style="padding: 0px; margin: 0px;"> expression </span><span class="pun" style="padding: 0px; margin: 0px;">|</span><span class="pln" style="padding: 0px; margin: 0px;"> DEFAULT </span><span class="pun" style="padding: 0px; margin: 0px;">}</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">[,</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">...]</span><span class="pln" style="padding: 0px; margin: 0px;">
</span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> FROM from_list </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;">
</span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> WHERE condition </span><span class="pun" style="padding: 0px; margin: 0px;">]</span>

VACUUM

垃圾收集和分析数据库(可选).

<span class="pln" style="padding: 0px; margin: 0px;">VACUUM </span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> FULL </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> FREEZE </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> VERBOSE </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> table </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;">
VACUUM </span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> FULL </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> FREEZE </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> VERBOSE </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;"> ANALYZE </span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> table </span><span class="pun" style="padding: 0px; margin: 0px;">[</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">(</span><span class="pln" style="padding: 0px; margin: 0px;">column </span><span class="pun" style="padding: 0px; margin: 0px;">[,</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">...]</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">)</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">]</span><span class="pln" style="padding: 0px; margin: 0px;"> </span><span class="pun" style="padding: 0px; margin: 0px;">]</span>

0
0

查看评论
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
    个人资料
    • 访问:4338次
    • 积分:97
    • 等级:
    • 排名:千里之外
    • 原创:2篇
    • 转载:18篇
    • 译文:0篇
    • 评论:0条
    文章分类