SQL Syntax Summary

ABORT

放弃当前事务.

  1. ABORT [WORK | TRANSACTION]

See ABORT for more information.

ALTER AGGREGATE

修改聚集函数的定义。

  1. ALTER AGGREGATE name ( type [ , ... ] ) RENAME TO new_name
  2. ALTER AGGREGATE name ( type [ , ... ] ) OWNER TO new_owner
  3. ALTER AGGREGATE name ( type [ , ... ] ) SET SCHEMA new_schema

See ALTER AGGREGATE for more information.

ALTER COLLATION

修改字符集的定义。

  1. ALTER COLLATION name RENAME TO new_name
  2. ALTER COLLATION name OWNER TO new_owner
  3. ALTER COLLATION name SET SCHEMA new_schema

See ALTER COLLATION for more information.

ALTER CONVERSION

更改一个转换的定义。

  1. ALTER CONVERSION name RENAME TO newname
  2. ALTER CONVERSION name OWNER TO newowner
  3. ALTER CONVERSION name SET SCHEMA new_schema

See ALTER CONVERSION for more information.

ALTER DATABASE

修改数据库的属性

  1. ALTER DATABASE name [ WITH CONNECTION LIMIT connlimit ]
  2. ALTER DATABASE name RENAME TO newname
  3. ALTER DATABASE name OWNER TO new_owner
  4. ALTER DATABASE name SET TABLESPACE new_tablespace
  5. ALTER DATABASE name SET parameter { TO | = } { value | DEFAULT }
  6. ALTER DATABASE name SET parameter FROM CURRENT
  7. ALTER DATABASE name RESET parameter
  8. ALTER DATABASE name RESET ALL

See ALTER DATABASE for more information.

ALTER DEFAULT PRIVILEGES

修改默认的访问权限。

  1. ALTER DEFAULT PRIVILEGES
  2. [ FOR { ROLE | USER } target_role [, ...] ]
  3. [ IN SCHEMA schema_name [, ...] ]
  4. abbreviated_grant_or_revoke
  5. where abbreviated_grant_or_revoke is one of:
  6. GRANT { { SELECT | INSERT | UPDATE | DELETE | TRUNCATE | REFERENCES | TRIGGER }
  7. [, ...] | ALL [ PRIVILEGES ] }
  8. ON TABLES
  9. TO { [ GROUP ] role_name | PUBLIC } [, ...] [ WITH GRANT OPTION ]
  10. GRANT { { USAGE | SELECT | UPDATE }
  11. [, ...] | ALL [ PRIVILEGES ] }
  12. ON SEQUENCES
  13. TO { [ GROUP ] role_name | PUBLIC } [, ...] [ WITH GRANT OPTION ]
  14. GRANT { EXECUTE | ALL [ PRIVILEGES ] }
  15. ON FUNCTIONS
  16. TO { [ GROUP ] role_name | PUBLIC } [, ...] [ WITH GRANT OPTION ]
  17. GRANT { USAGE | ALL [ PRIVILEGES ] }
  18. ON TYPES
  19. TO { [ GROUP ] role_name | PUBLIC } [, ...] [ WITH GRANT OPTION ]
  20. REVOKE [ GRANT OPTION FOR ]
  21. { { SELECT | INSERT | UPDATE | DELETE | TRUNCATE | REFERENCES | TRIGGER }
  22. [, ...] | ALL [ PRIVILEGES ] }
  23. ON TABLES
  24. FROM { [ GROUP ] role_name | PUBLIC } [, ...]
  25. [ CASCADE | RESTRICT ]
  26. REVOKE [ GRANT OPTION FOR ]
  27. { { USAGE | SELECT | UPDATE }
  28. [, ...] | ALL [ PRIVILEGES ] }
  29. ON SEQUENCES
  30. FROM { [ GROUP ] role_name | PUBLIC } [, ...]
  31. [ CASCADE | RESTRICT ]
  32. REVOKE [ GRANT OPTION FOR ]
  33. { EXECUTE | ALL [ PRIVILEGES ] }
  34. ON FUNCTIONS
  35. FROM { [ GROUP ] role_name | PUBLIC } [, ...]
  36. [ CASCADE | RESTRICT ]
  37. REVOKE [ GRANT OPTION FOR ]
  38. { USAGE | ALL [ PRIVILEGES ] }
  39. ON TYPES
  40. FROM { [ GROUP ] role_name | PUBLIC } [, ...]
  41. [ CASCADE | RESTRICT ]

See ALTER DEFAULT PRIVILEGES for more information.

ALTER DOMAIN

更改现有域的定义。

  1. ALTER DOMAIN name { SET DEFAULT expression | DROP DEFAULT }
  2. ALTER DOMAIN name { SET | DROP } NOT NULL
  3. ALTER DOMAIN name ADD domain_constraint [ NOT VALID ]
  4. ALTER DOMAIN name DROP CONSTRAINT [ IF EXISTS ] constraint_name [RESTRICT | CASCADE]
  5. ALTER DOMAIN name RENAME CONSTRAINT constraint_name TO new_constraint_name
  6. ALTER DOMAIN name VALIDATE CONSTRAINT constraint_name
  7. ALTER DOMAIN name OWNER TO new_owner
  8. ALTER DOMAIN name RENAME TO new_name
  9. ALTER DOMAIN name SET SCHEMA new_schema

See ALTER DOMAIN for more information.

ALTER EXTENSION

更改在Greenplum数据库中注册的扩展的定义。

  1. ALTER EXTENSION name UPDATE [ TO new_version ]
  2. ALTER EXTENSION name SET SCHEMA new_schema
  3. ALTER EXTENSION name ADD member_object
  4. ALTER EXTENSION name DROP member_object
  5. where member_object is:
  6. ACCESS METHOD object_name |
  7. AGGREGATE aggregate_name ( aggregate_signature ) |
  8. CAST (source_type AS target_type) |
  9. COLLATION object_name |
  10. CONVERSION object_name |
  11. DOMAIN object_name |
  12. EVENT TRIGGER object_name |
  13. FOREIGN DATA WRAPPER object_name |
  14. FOREIGN TABLE object_name |
  15. FUNCTION function_name ( [ [ argmode ] [ argname ] argtype [, ...] ] ) |
  16. MATERIALIZED VIEW object_name |
  17. OPERATOR operator_name (left_type, right_type) |
  18. OPERATOR CLASS object_name USING index_method |
  19. OPERATOR FAMILY object_name USING index_method |
  20. [ PROCEDURAL ] LANGUAGE object_name |
  21. SCHEMA object_name |
  22. SEQUENCE object_name |
  23. SERVER object_name |
  24. TABLE object_name |
  25. TEXT SEARCH CONFIGURATION object_name |
  26. TEXT SEARCH DICTIONARY object_name |
  27. TEXT SEARCH PARSER object_name |
  28. TEXT SEARCH TEMPLATE object_name |
  29. TRANSFORM FOR type_name LANGUAGE lang_name |
  30. TYPE object_name |
  31. VIEW object_name
  32. and aggregate_signature is:
  33. * | [ argmode ] [ argname ] argtype [ , ... ] |
  34. [ [ argmode ] [ argname ] argtype [ , ... ] ]
  35. ORDER BY [ argmode ] [ argname ] argtype [ , ... ]

See ALTER EXTENSION for more information.

ALTER EXTERNAL TABLE

更改一个外部表的定义。

  1. ALTER EXTERNAL TABLE name action [, ... ]

where action is one of:

  1. ADD [COLUMN] new_column type
  2. DROP [COLUMN] column [RESTRICT|CASCADE]
  3. ALTER [COLUMN] column TYPE type
  4. OWNER TO new_owner

See ALTER EXTERNAL TABLE for more information.

ALTER FOREIGN DATA WRAPPER

修改一个外部数据包装的定义。

  1. ALTER FOREIGN DATA WRAPPER name
  2. [ HANDLER handler_function | NO HANDLER ]
  3. [ VALIDATOR validator_function | NO VALIDATOR ]
  4. [ OPTIONS ( [ ADD | SET | DROP ] option ['value'] [, ... ] ) ]
  5. ALTER FOREIGN DATA WRAPPER name OWNER TO new_owner
  6. ALTER FOREIGN DATA WRAPPER name RENAME TO new_name

See ALTER FOREIGN DATA WRAPPER for more information.

ALTER FOREIGN TABLE

修改外表的定义。

  1. ALTER FOREIGN TABLE [ IF EXISTS ] name
  2. action [, ... ]
  3. ALTER FOREIGN TABLE [ IF EXISTS ] name
  4. RENAME [ COLUMN ] column_name TO new_column_name
  5. ALTER FOREIGN TABLE [ IF EXISTS ] name
  6. RENAME TO new_name
  7. ALTER FOREIGN TABLE [ IF EXISTS ] name
  8. SET SCHEMA new_schema

See ALTER FOREIGN TABLE for more information.

ALTER FUNCTION

修改函数的定义。

  1. ALTER FUNCTION name ( [ [argmode] [argname] argtype [, ...] ] )
  2. action [, ... ] [RESTRICT]
  3. ALTER FUNCTION name ( [ [argmode] [argname] argtype [, ...] ] )
  4. RENAME TO new_name
  5. ALTER FUNCTION name ( [ [argmode] [argname] argtype [, ...] ] )
  6. OWNER TO new_owner
  7. ALTER FUNCTION name ( [ [argmode] [argname] argtype [, ...] ] )
  8. SET SCHEMA new_schema

See ALTER FUNCTION for more information.

ALTER GROUP

更改角色名称或成员关系。

  1. ALTER GROUP groupname ADD USER username [, ... ]
  2. ALTER GROUP groupname DROP USER username [, ... ]
  3. ALTER GROUP groupname RENAME TO newname

See ALTER GROUP for more information.

ALTER INDEX

更改一个索引的定义。

  1. ALTER INDEX [ IF EXISTS ] name RENAME TO new_name
  2. ALTER INDEX [ IF EXISTS ] name SET TABLESPACE tablespace_name
  3. ALTER INDEX [ IF EXISTS ] name SET ( storage_parameter = value [, ...] )
  4. ALTER INDEX [ IF EXISTS ] name RESET ( storage_parameter [, ...] )
  5. ALTER INDEX ALL IN TABLESPACE name [ OWNED BY role_name [, ... ] ]
  6. SET TABLESPACE new_tablespace [ NOWAIT ]

See ALTER INDEX for more information.

ALTER LANGUAGE

更改过程语言的名称。

  1. ALTER LANGUAGE name RENAME TO newname
  2. ALTER LANGUAGE name OWNER TO new_owner

See ALTER LANGUAGE for more information.

ALTER OPERATOR

更改操作符的定义。

  1. ALTER OPERATOR name ( {left_type | NONE} , {right_type | NONE} )
  2. OWNER TO new_owner
  3. ALTER OPERATOR name ( {left_type | NONE} , {right_type | NONE} )
  4. SET SCHEMA new_schema

See ALTER OPERATOR for more information.

ALTER OPERATOR CLASS

更改一个操作符类的定义。

  1. ALTER OPERATOR CLASS name USING index_method RENAME TO new_name
  2. ALTER OPERATOR CLASS name USING index_method OWNER TO new_owner
  3. ALTER OPERATOR CLASS name USING index_method SET SCHEMA new_schema

See ALTER OPERATOR CLASS for more information.

ALTER OPERATOR FAMILY

更改操作符族的定义。

  1. ALTER OPERATOR FAMILY name USING index_method ADD
  2. { OPERATOR strategy_number operator_name ( op_type, op_type ) [ FOR SEARCH | FOR ORDER BY sort_family_name ]
  3. | FUNCTION support_number [ ( op_type [ , op_type ] ) ] funcname ( argument_type [, ...] )
  4. } [, ... ]
  5. ALTER OPERATOR FAMILY name USING index_method DROP
  6. { OPERATOR strategy_number ( op_type, op_type )
  7. | FUNCTION support_number [ ( op_type [ , op_type ] )
  8. } [, ... ]
  9. ALTER OPERATOR FAMILY name USING index_method RENAME TO new_name
  10. ALTER OPERATOR FAMILY name USING index_method OWNER TO new_owner
  11. ALTER OPERATOR FAMILY name USING index_method SET SCHEMA new_schema

See ALTER OPERATOR FAMILY for more information.

ALTER PROTOCOL

更改一个协议的定义。

  1. ALTER PROTOCOL name RENAME TO newname
  2. ALTER PROTOCOL name OWNER TO newowner

See ALTER PROTOCOL for more information.

ALTER RESOURCE GROUP

更改一个资源组的限制项。

  1. ALTER RESOURCE GROUP name SET group_attribute value

See ALTER RESOURCE GROUP for more information.

ALTER RESOURCE QUEUE

更改资源队列的限制。

  1. ALTER RESOURCE QUEUE name WITH ( queue_attribute=value [, ... ] )

See ALTER RESOURCE QUEUE for more information.

ALTER ROLE

更改一个数据库角色(用户或组)。

  1. ALTER ROLE name [ [ WITH ] option [ ... ] ]
  2. 其中 option 可以是:
  3. SUPERUSER | NOSUPERUSER
  4. | CREATEDB | NOCREATEDB
  5. | CREATEROLE | NOCREATEROLE
  6. | CREATEEXTTABLE | NOCREATEEXTTABLE [ ( attribute='value' [, ...] )
  7. where attributes and values are:
  8. type='readable'|'writable'
  9. protocol='gpfdist'|'http'
  10. | INHERIT | NOINHERIT
  11. | LOGIN | NOLOGIN
  12. | REPLICATION | NOREPLICATION
  13. | CONNECTION LIMIT connlimit
  14. | [ ENCRYPTED | UNENCRYPTED ] PASSWORD 'password'
  15. | VALID UNTIL 'timestamp'
  16. ALTER ROLE name RENAME TO new_name
  17. ALTER ROLE { name | ALL } [ IN DATABASE database_name ] SET configuration_parameter { TO | = } { value | DEFAULT }
  18. ALTER ROLE { name | ALL } [ IN DATABASE database_name ] SET configuration_parameter FROM CURRENT
  19. ALTER ROLE { name | ALL } [ IN DATABASE database_name ] RESET configuration_parameter
  20. ALTER ROLE { name | ALL } [ IN DATABASE database_name ] RESET ALL
  21. ALTER ROLE name RESOURCE QUEUE {queue_name | NONE}
  22. ALTER ROLE name RESOURCE GROUP {group_name | NONE}

See ALTER ROLE for more information.

ALTER RULE

修改一个规则的定义。

  1. ALTER RULE name ON table_name RENAME TO new_name

See ALTER RULE for more information.

ALTER SCHEMA

更改一个模式定义。

  1. ALTER SCHEMA name RENAME TO newname
  2. ALTER SCHEMA name OWNER TO newowner

See ALTER SCHEMA for more information.

ALTER SEQUENCE

更改一个序列发生器的定义。

  1. ALTER SEQUENCE [ IF EXISTS ] name [INCREMENT [ BY ] increment]
  2. [MINVALUE minvalue | NO MINVALUE]
  3. [MAXVALUE maxvalue | NO MAXVALUE]
  4. [START [ WITH ] start ]
  5. [RESTART [ [ WITH ] restart] ]
  6. [CACHE cache] [[ NO ] CYCLE]
  7. [OWNED BY {table.column | NONE}]
  8. ALTER SEQUENCE [ IF EXISTS ] name OWNER TO new_owner
  9. ALTER SEQUENCE [ IF EXISTS ] name RENAME TO new_name
  10. ALTER SEQUENCE [ IF EXISTS ] name SET SCHEMA new_schema

See ALTER SEQUENCE for more information.

ALTER SERVER

修改一个外部服务器的定义。

  1. ALTER SERVER server_name [ VERSION 'new_version' ]
  2. [ OPTIONS ( [ ADD | SET | DROP ] option ['value'] [, ... ] ) ]
  3. ALTER SERVER server_name OWNER TO new_owner
  4. ALTER SERVER server_name RENAME TO new_name

See ALTER SERVER for more information.

ALTER TABLE

更改一个表的定义。

  1. ALTER TABLE [IF EXISTS] [ONLY] name
  2. action [, ... ]
  3. ALTER TABLE [IF EXISTS] [ONLY] name
  4. RENAME [COLUMN] column_name TO new_column_name
  5. ALTER TABLE [ IF EXISTS ] [ ONLY ] name
  6. RENAME CONSTRAINT constraint_name TO new_constraint_name
  7. ALTER TABLE [IF EXISTS] name
  8. RENAME TO new_name
  9. ALTER TABLE [IF EXISTS] name
  10. SET SCHEMA new_schema
  11. ALTER TABLE ALL IN TABLESPACE name [ OWNED BY role_name [, ... ] ]
  12. SET TABLESPACE new_tablespace [ NOWAIT ]
  13. ALTER TABLE [IF EXISTS] [ONLY] name SET
  14. WITH (REORGANIZE=true|false)
  15. | DISTRIBUTED BY ({column_name [opclass]} [, ... ] )
  16. | DISTRIBUTED RANDOMLY
  17. | DISTRIBUTED REPLICATED
  18. ALTER TABLE name
  19. [ ALTER PARTITION { partition_name | FOR (RANK(number))
  20. | FOR (value) } partition_action [...] ]
  21. partition_action
  22. 其中 action 是下列之一:
  23. ADD [COLUMN] column_name data_type [ DEFAULT default_expr ]
  24. [column_constraint [ ... ]]
  25. [ COLLATE collation ]
  26. [ ENCODING ( storage_directive [,...] ) ]
  27. DROP [COLUMN] [IF EXISTS] column_name [RESTRICT | CASCADE]
  28. ALTER [COLUMN] column_name [ SET DATA ] TYPE type [COLLATE collation] [USING expression]
  29. ALTER [COLUMN] column_name SET DEFAULT expression
  30. ALTER [COLUMN] column_name DROP DEFAULT
  31. ALTER [COLUMN] column_name { SET | DROP } NOT NULL
  32. ALTER [COLUMN] column_name SET STATISTICS integer
  33. ALTER [COLUMN] column SET ( attribute_option = value [, ... ] )
  34. ALTER [COLUMN] column RESET ( attribute_option [, ... ] )
  35. ADD table_constraint [NOT VALID]
  36. ADD table_constraint_using_index
  37. VALIDATE CONSTRAINT constraint_name
  38. DROP CONSTRAINT [IF EXISTS] constraint_name [RESTRICT | CASCADE]
  39. DISABLE TRIGGER [trigger_name | ALL | USER]
  40. ENABLE TRIGGER [trigger_name | ALL | USER]
  41. CLUSTER ON index_name
  42. SET WITHOUT CLUSTER
  43. SET WITH OIDS
  44. SET WITHOUT OIDS
  45. SET (storage_parameter = value)
  46. RESET (storage_parameter [, ... ])
  47. INHERIT parent_table
  48. NO INHERIT parent_table
  49. OF type_name
  50. NOT OF
  51. OWNER TO new_owner
  52. SET TABLESPACE new_tablespace

See ALTER TABLE for more information.

ALTER TABLESPACE

更改表空间的定义。

  1. ALTER TABLESPACE name RENAME TO new_name
  2. ALTER TABLESPACE name OWNER TO new_owner
  3. ALTER TABLESPACE name SET ( tablespace_option = value [, ... ] )
  4. ALTER TABLESPACE name RESET ( tablespace_option [, ... ] )

See ALTER TABLESPACE for more information.

ALTER TEXT SEARCH CONFIGURATION

更改文本搜索配置的定义。

  1. ALTER TEXT SEARCH CONFIGURATION name
  2. ALTER MAPPING FOR token_type [, ... ] WITH dictionary_name [, ... ]
  3. ALTER TEXT SEARCH CONFIGURATION name
  4. ALTER MAPPING REPLACE old_dictionary WITH new_dictionary
  5. ALTER TEXT SEARCH CONFIGURATION name
  6. ALTER MAPPING FOR token_type [, ... ] REPLACE old_dictionary WITH new_dictionary
  7. ALTER TEXT SEARCH CONFIGURATION name
  8. DROP MAPPING [ IF EXISTS ] FOR token_type [, ... ]
  9. ALTER TEXT SEARCH CONFIGURATION name RENAME TO new_name
  10. ALTER TEXT SEARCH CONFIGURATION name OWNER TO new_owner
  11. ALTER TEXT SEARCH CONFIGURATION name SET SCHEMA new_schema

See ALTER TEXT SEARCH CONFIGURATION for more information.

ALTER TEXT SEARCH DICTIONARY

更改文本搜索词典的定义。

  1. ALTER TEXT SEARCH DICTIONARY name (
  2. option [ = value ] [, ... ]
  3. )
  4. ALTER TEXT SEARCH DICTIONARY name RENAME TO new_name
  5. ALTER TEXT SEARCH DICTIONARY name OWNER TO new_owner
  6. ALTER TEXT SEARCH DICTIONARY name SET SCHEMA new_schema

See ALTER TEXT SEARCH DICTIONARY for more information.

ALTER TEXT SEARCH PARSER

更改文本搜索解析器的定义。

  1. ALTER TEXT SEARCH PARSER name RENAME TO new_name
  2. ALTER TEXT SEARCH PARSER name SET SCHEMA new_schema

See ALTER TEXT SEARCH PARSER for more information.

ALTER TEXT SEARCH TEMPLATE

更改文本搜索模板的定义。

  1. ALTER TEXT SEARCH TEMPLATE name RENAME TO new_name
  2. ALTER TEXT SEARCH TEMPLATE name SET SCHEMA new_schema

See ALTER TEXT SEARCH TEMPLATE for more information.

ALTER TYPE

更改一个数据类型的定义。

  1. ALTER TYPE name action [, ... ]
  2. ALTER TYPE name OWNER TO new_owner
  3. ALTER TYPE name RENAME ATTRIBUTE attribute_name TO new_attribute_name [ CASCADE | RESTRICT ]
  4. ALTER TYPE name RENAME TO new_name
  5. ALTER TYPE name SET SCHEMA new_schema
  6. ALTER TYPE name ADD VALUE [ IF NOT EXISTS ] new_enum_value [ { BEFORE | AFTER } existing_enum_value ]
  7. ALTER TYPE name SET DEFAULT ENCODING ( storage_directive )
  8. 其中 action是下列选项之一:
  9. ADD ATTRIBUTE attribute_name data_type [ COLLATE collation ] [ CASCADE | RESTRICT ]
  10. DROP ATTRIBUTE [ IF EXISTS ] attribute_name [ CASCADE | RESTRICT ]
  11. ALTER ATTRIBUTE attribute_name [ SET DATA ] TYPE data_type [ COLLATE collation ] [ CASCADE | RESTRICT ]

See ALTER TYPE for more information.

ALTER USER

更改数据库用户(角色)的定义。

  1. ALTER USER name RENAME TO newname
  2. ALTER USER name SET config_parameter {TO | =} {value | DEFAULT}
  3. ALTER USER name RESET config_parameter
  4. ALTER USER name RESOURCE QUEUE {queue_name | NONE}
  5. ALTER USER name RESOURCE GROUP {group_name | NONE}
  6. ALTER USER name [ [WITH] option [ ... ] ]

See ALTER USER for more information.

ALTER USER MAPPING

更改外部服务器的用户映射的定义。

  1. ALTER USER MAPPING FOR { username | USER | CURRENT_USER | PUBLIC }
  2. SERVER servername
  3. OPTIONS ( [ ADD | SET | DROP ] option ['value'] [, ... ] )

See ALTER USER MAPPING for more information.

ALTER VIEW

更改一个视图的定义。

  1. ALTER VIEW [ IF EXISTS ] name ALTER [ COLUMN ] column_name SET DEFAULT expression
  2. ALTER VIEW [ IF EXISTS ] name ALTER [ COLUMN ] column_name DROP DEFAULT
  3. ALTER VIEW [ IF EXISTS ] name OWNER TO new_owner
  4. ALTER VIEW [ IF EXISTS ] name RENAME TO new_name
  5. ALTER VIEW [ IF EXISTS ] name SET SCHEMA new_schema
  6. ALTER VIEW [ IF EXISTS ] name SET ( view_option_name [= view_option_value] [, ... ] )
  7. ALTER VIEW [ IF EXISTS ] name RESET ( view_option_name [, ... ] )

See ALTER VIEW for more information.

ANALYZE

收集有关一个数据库的统计信息。

  1. ANALYZE [VERBOSE] [table [ (column [, ...] ) ]]
  2. ANALYZE [VERBOSE] {root_partition|leaf_partition} [ (column [, ...] )]
  3. ANALYZE [VERBOSE] ROOTPARTITION {ALL | root_partition [ (column [, ...] )]}

See ANALYZE for more information.

BEGIN

启动事务块。

  1. BEGIN [WORK | TRANSACTION] [transaction_mode]

See BEGIN for more information.

CHECKPOINT

强制执行事务日志检查点。

  1. CHECKPOINT

See CHECKPOINT for more information.

CLOSE

关闭游标。

  1. CLOSE cursor_name

See CLOSE for more information.

CLUSTER

根据索引对磁盘上的堆存储表进行物理重新排序。 在Greenplum数据库中不建议执行此操作。

  1. CLUSTER indexname ON tablename
  2. CLUSTER [VERBOSE] tablename
  3. CLUSTER [VERBOSE]

See CLUSTER for more information.

COMMENT

定义或更改对象的注释。

  1. COMMENT ON
  2. { TABLE object_name |
  3. COLUMN relation_name.column_name |
  4. AGGREGATE agg_name (agg_type [, ...]) |
  5. CAST (source_type AS target_type) |
  6. COLLATION object_name
  7. CONSTRAINT constraint_name ON table_name |
  8. CONVERSION object_name |
  9. DATABASE object_name |
  10. DOMAIN object_name |
  11. EXTENSION object_name |
  12. FOREIGN DATA WRAPPER object_name |
  13. FOREIGN TABLE object_name |
  14. FUNCTION func_name ([[argmode] [argname] argtype [, ...]]) |
  15. INDEX object_name |
  16. LARGE OBJECT large_object_oid |
  17. OPERATOR operator_name (left_type, right_type) |
  18. OPERATOR CLASS object_name USING index_method |
  19. [PROCEDURAL] LANGUAGE object_name |
  20. RESOURCE GROUP object_name |
  21. RESOURCE QUEUE object_name |
  22. ROLE object_name |
  23. RULE rule_name ON table_name |
  24. SCHEMA object_name |
  25. SEQUENCE object_name |
  26. SERVER object_name |
  27. TABLESPACE object_name |
  28. TRIGGER trigger_name ON table_name |
  29. TYPE object_name |
  30. VIEW object_name }
  31. IS 'text'

See COMMENT for more information.

COMMIT

提交当前事务。

  1. COMMIT [WORK | TRANSACTION]

See COMMIT for more information.

COPY

在文件和表之间复制数据。

  1. COPY table_name [(column_name [, ...])]
  2. FROM {'filename' | PROGRAM 'command' | STDIN}
  3. [ [ WITH ] ( option [, ...] ) ]
  4. [ ON SEGMENT ]
  5. COPY { table_name [(column_name [, ...])] | (query)}
  6. TO {'filename' | PROGRAM 'command' | STDOUT}
  7. [ [ WITH ] ( option [, ...] ) ]
  8. [ ON SEGMENT ]

See COPY for more information.

CREATE AGGREGATE

定义一个新的聚集函数

  1. CREATE AGGREGATE name ( [ argmode ] [ ] arg_data_type [ , ... ] ) (
  2. SFUNC = sfunc,
  3. STYPE = state_data_type
  4. [ , SSPACE = state_data_size ]
  5. [ , FINALFUNC = ffunc ]
  6. [ , FINALFUNC_EXTRA ]
  7. [ , COMBINEFUNC = combinefunc ]
  8. [ , SERIALFUNC = serialfunc ]
  9. [ , DESERIALFUNC = deserialfunc ]
  10. [ , INITCOND = initial_condition ]
  11. [ , MSFUNC = msfunc ]
  12. [ , MINVFUNC = minvfunc ]
  13. [ , MSTYPE = mstate_data_type ]
  14. [ , MSSPACE = mstate_data_size ]
  15. [ , MFINALFUNC = mffunc ]
  16. [ , MFINALFUNC_EXTRA ]
  17. [ , MINITCOND = minitial_condition ]
  18. [ , SORTOP = sort_operator ]
  19. )
  20. CREATE AGGREGATE name ( [ [ argmode ] [ argname ] arg_data_type [ , ... ] ]
  21. ORDER BY [ argmode ] [ argname ] arg_data_type [ , ... ] ) (
  22. SFUNC = sfunc,
  23. STYPE = state_data_type
  24. [ , SSPACE = state_data_size ]
  25. [ , FINALFUNC = ffunc ]
  26. [ , FINALFUNC_EXTRA ]
  27. [ , COMBINEFUNC = combinefunc ]
  28. [ , SERIALFUNC = serialfunc ]
  29. [ , DESERIALFUNC = deserialfunc ]
  30. [ , INITCOND = initial_condition ]
  31. [ , HYPOTHETICAL ]
  32. )
  33. or the old syntax
  34. CREATE AGGREGATE name (
  35. BASETYPE = base_type,
  36. SFUNC = sfunc,
  37. STYPE = state_data_type
  38. [ , SSPACE = state_data_size ]
  39. [ , FINALFUNC = ffunc ]
  40. [ , FINALFUNC_EXTRA ]
  41. [ , COMBINEFUNC = combinefunc ]
  42. [ , SERIALFUNC = serialfunc ]
  43. [ , DESERIALFUNC = deserialfunc ]
  44. [ , INITCOND = initial_condition ]
  45. [ , MSFUNC = msfunc ]
  46. [ , MINVFUNC = minvfunc ]
  47. [ , MSTYPE = mstate_data_type ]
  48. [ , MSSPACE = mstate_data_size ]
  49. [ , MFINALFUNC = mffunc ]
  50. [ , MFINALFUNC_EXTRA ]
  51. [ , MINITCOND = minitial_condition ]
  52. [ , SORTOP = sort_operator ]
  53. )

See CREATE AGGREGATE for more information.

CREATE CAST

定义一种新的造型。

  1. CREATE CAST (sourcetype AS targettype)
  2. WITH FUNCTION funcname (argtype [, ...])
  3. [AS ASSIGNMENT | AS IMPLICIT]
  4. CREATE CAST (sourcetype AS targettype)
  5. WITHOUT FUNCTION
  6. [AS ASSIGNMENT | AS IMPLICIT]
  7. CREATE CAST (sourcetype AS targettype)
  8. WITH INOUT
  9. [AS ASSIGNMENT | AS IMPLICIT]

See CREATE CAST for more information.

CREATE COLLATION

使用指定的操作系统语言环境或通过复制现有的排序规则来定义新的排序规则。

  1. CREATE COLLATION name (
  2. [ LOCALE = locale, ]
  3. [ LC_COLLATE = lc_collate, ]
  4. [ LC_CTYPE = lc_ctype ])
  5. CREATE COLLATION name FROM existing_collation

See CREATE COLLATION for more information.

CREATE CONVERSION

定义新的编码转换。

  1. CREATE [DEFAULT] CONVERSION name FOR source_encoding TO
  2. dest_encoding FROM funcname

See CREATE CONVERSION for more information.

CREATE DATABASE

创建一个新的数据库。

  1. CREATE DATABASE name [ [WITH] [OWNER [=] user_name]
  2. [TEMPLATE [=] template]
  3. [ENCODING [=] encoding]
  4. [LC_COLLATE [=] lc_collate]
  5. [LC_CTYPE [=] lc_ctype]
  6. [TABLESPACE [=] tablespace]
  7. [CONNECTION LIMIT [=] connlimit ] ]

See CREATE DATABASE for more information.

CREATE DOMAIN

定义一个新域。

  1. CREATE DOMAIN name [AS] data_type [DEFAULT expression]
  2. [ COLLATE collation ]
  3. [ CONSTRAINT constraint_name
  4. | NOT NULL | NULL
  5. | CHECK (expression) [...]]

See CREATE DOMAIN for more information.

CREATE EXTENSION

Registers an extension in a Greenplum database.

  1. CREATE EXTENSION [ IF NOT EXISTS ] extension_name
  2. [ WITH ] [ SCHEMA schema_name ]
  3. [ VERSION version ]
  4. [ FROM old_version ]
  5. [ CASCADE ]

See CREATE EXTENSION for more information.

CREATE EXTERNAL TABLE

定义一个新的外部表。

  1. CREATE [READABLE] EXTERNAL [TEMPORARY | TEMP] TABLE table_name
  2. ( column_name data_type [, ...] | LIKE other_table )
  3. LOCATION ('file://seghost[:port]/path/file' [, ...])
  4. | ('gpfdist://filehost[:port]/file_pattern[#transform=trans_name]'
  5. [, ...]
  6. | ('gpfdists://filehost[:port]/file_pattern[#transform=trans_name]'
  7. [, ...])
  8. | ('pxf://path-to-data?PROFILE=profile_name[&SERVER=server_name][&custom-option=value[...]]'))
  9. | ('s3://S3_endpoint[:port]/bucket_name/[S3_prefix] [region=S3-region] [config=config_file]')
  10. [ON MASTER]
  11. FORMAT 'TEXT'
  12. [( [HEADER]
  13. [DELIMITER [AS] 'delimiter' | 'OFF']
  14. [NULL [AS] 'null string']
  15. [ESCAPE [AS] 'escape' | 'OFF']
  16. [NEWLINE [ AS ] 'LF' | 'CR' | 'CRLF']
  17. [FILL MISSING FIELDS] )]
  18. | 'CSV'
  19. [( [HEADER]
  20. [QUOTE [AS] 'quote']
  21. [DELIMITER [AS] 'delimiter']
  22. [NULL [AS] 'null string']
  23. [FORCE NOT NULL column [, ...]]
  24. [ESCAPE [AS] 'escape']
  25. [NEWLINE [ AS ] 'LF' | 'CR' | 'CRLF']
  26. [FILL MISSING FIELDS] )]
  27. | 'CUSTOM' (Formatter=<formatter_specifications>)
  28. [ ENCODING 'encoding' ]
  29. [ [LOG ERRORS] SEGMENT REJECT LIMIT count
  30. [ROWS | PERCENT] ]
  31. CREATE [READABLE] EXTERNAL WEB [TEMPORARY | TEMP] TABLE table_name
  32. ( column_name data_type [, ...] | LIKE other_table )
  33. LOCATION ('http://webhost[:port]/path/file' [, ...])
  34. | EXECUTE 'command' [ON ALL
  35. | MASTER
  36. | number_of_segments
  37. | HOST ['segment_hostname']
  38. | SEGMENT segment_id ]
  39. FORMAT 'TEXT'
  40. [( [HEADER]
  41. [DELIMITER [AS] 'delimiter' | 'OFF']
  42. [NULL [AS] 'null string']
  43. [ESCAPE [AS] 'escape' | 'OFF']
  44. [NEWLINE [ AS ] 'LF' | 'CR' | 'CRLF']
  45. [FILL MISSING FIELDS] )]
  46. | 'CSV'
  47. [( [HEADER]
  48. [QUOTE [AS] 'quote']
  49. [DELIMITER [AS] 'delimiter']
  50. [NULL [AS] 'null string']
  51. [FORCE NOT NULL column [, ...]]
  52. [ESCAPE [AS] 'escape']
  53. [NEWLINE [ AS ] 'LF' | 'CR' | 'CRLF']
  54. [FILL MISSING FIELDS] )]
  55. | 'CUSTOM' (Formatter=<formatter specifications>)
  56. [ ENCODING 'encoding' ]
  57. [ [LOG ERRORS] SEGMENT REJECT LIMIT count
  58. [ROWS | PERCENT] ]
  59. CREATE WRITABLE EXTERNAL [TEMPORARY | TEMP] TABLE table_name
  60. ( column_name data_type [, ...] | LIKE other_table )
  61. LOCATION('gpfdist://outputhost[:port]/filename[#transform=trans_name]'
  62. [, ...])
  63. | ('gpfdists://outputhost[:port]/file_pattern[#transform=trans_name]'
  64. [, ...])
  65. FORMAT 'TEXT'
  66. [( [DELIMITER [AS] 'delimiter']
  67. [NULL [AS] 'null string']
  68. [ESCAPE [AS] 'escape' | 'OFF'] )]
  69. | 'CSV'
  70. [([QUOTE [AS] 'quote']
  71. [DELIMITER [AS] 'delimiter']
  72. [NULL [AS] 'null string']
  73. [FORCE QUOTE column [, ...]] | * ]
  74. [ESCAPE [AS] 'escape'] )]
  75. | 'CUSTOM' (Formatter=<formatter specifications>)
  76. [ ENCODING 'write_encoding' ]
  77. [ DISTRIBUTED BY ({column [opclass]}, [ ... ] ) | DISTRIBUTED RANDOMLY ]
  78. CREATE WRITABLE EXTERNAL [TEMPORARY | TEMP] TABLE table_name
  79. ( column_name data_type [, ...] | LIKE other_table )
  80. LOCATION('s3://S3_endpoint[:port]/bucket_name/[S3_prefix] [region=S3-region] [config=config_file]')
  81. [ON MASTER]
  82. FORMAT 'TEXT'
  83. [( [DELIMITER [AS] 'delimiter']
  84. [NULL [AS] 'null string']
  85. [ESCAPE [AS] 'escape' | 'OFF'] )]
  86. | 'CSV'
  87. [([QUOTE [AS] 'quote']
  88. [DELIMITER [AS] 'delimiter']
  89. [NULL [AS] 'null string']
  90. [FORCE QUOTE column [, ...]] | * ]
  91. [ESCAPE [AS] 'escape'] )]
  92. CREATE WRITABLE EXTERNAL WEB [TEMPORARY | TEMP] TABLE table_name
  93. ( column_name data_type [, ...] | LIKE other_table )
  94. EXECUTE 'command' [ON ALL]
  95. FORMAT 'TEXT'
  96. [( [DELIMITER [AS] 'delimiter']
  97. [NULL [AS] 'null string']
  98. [ESCAPE [AS] 'escape' | 'OFF'] )]
  99. | 'CSV'
  100. [([QUOTE [AS] 'quote']
  101. [DELIMITER [AS] 'delimiter']
  102. [NULL [AS] 'null string']
  103. [FORCE QUOTE column [, ...]] | * ]
  104. [ESCAPE [AS] 'escape'] )]
  105. | 'CUSTOM' (Formatter=<formatter specifications>)
  106. [ ENCODING 'write_encoding' ]
  107. [ DISTRIBUTED BY ({column [opclass]}, [ ... ] ) | DISTRIBUTED RANDOMLY ]

See CREATE EXTERNAL TABLE for more information.

CREATE FOREIGN DATA WRAPPER

定义一个新的外部数据包装器。

  1. CREATE FOREIGN DATA WRAPPER name
  2. [ HANDLER handler_function | NO HANDLER ]
  3. [ VALIDATOR validator_function | NO VALIDATOR ]
  4. [ OPTIONS ( [ mpp_execute { 'master' | 'any' | 'all segments' } [, ] ] option 'value' [, ... ] ) ]

See CREATE FOREIGN DATA WRAPPER for more information.

CREATE FOREIGN TABLE

定义一个新的外部表。

  1. CREATE FOREIGN TABLE [ IF NOT EXISTS ] table_name ( [
  2. column_name data_type [ OPTIONS ( option 'value' [, ... ] ) ] [ COLLATE collation ] [ column_constraint [ ... ] ]
  3. [, ... ]
  4. ] )
  5. SERVER server_name
  6. [ OPTIONS ( [ mpp_execute { 'master' | 'any' | 'all segments' } [, ] ] option 'value' [, ... ] ) ]

See CREATE FOREIGN TABLE for more information.

CREATE FUNCTION

定义一个新函数。

  1. CREATE [OR REPLACE] FUNCTION name
  2. ( [ [argmode] [argname] argtype [ { DEFAULT | = } default_expr ] [, ...] ] )
  3. [ RETURNS rettype
  4. | RETURNS TABLE ( column_name column_type [, ...] ) ]
  5. { LANGUAGE langname
  6. | WINDOW
  7. | IMMUTABLE | STABLE | VOLATILE | [NOT] LEAKPROOF
  8. | CALLED ON NULL INPUT | RETURNS NULL ON NULL INPUT | STRICT
  9. | [EXTERNAL] SECURITY INVOKER | [EXTERNAL] SECURITY DEFINER
  10. | EXECUTE ON { ANY | MASTER | ALL SEGMENTS }
  11. | COST execution_cost
  12. | SET configuration_parameter { TO value | = value | FROM CURRENT }
  13. | AS 'definition'
  14. | AS 'obj_file', 'link_symbol' } ...
  15. [ WITH ({ DESCRIBE = describe_function
  16. } [, ...] ) ]

See CREATE FUNCTION for more information.

CREATE GROUP

定义一个新的数据库角色。

  1. CREATE GROUP name [[WITH] option [ ... ]]

See CREATE GROUP for more information.

CREATE INDEX

定义一个新索引。

  1. CREATE [UNIQUE] INDEX [name] ON table_name [USING method]
  2. ( {column_name | (expression)} [COLLATE parameter] [opclass] [ ASC | DESC ] [ NULLS { FIRST | LAST } ] [, ...] )
  3. [ WITH ( storage_parameter = value [, ... ] ) ]
  4. [ TABLESPACE tablespace ]
  5. [ WHERE predicate ]

See CREATE INDEX for more information.

CREATE LANGUAGE

定义一种新的过程语言。

  1. CREATE [ OR REPLACE ] [ PROCEDURAL ] LANGUAGE name
  2. CREATE [ OR REPLACE ] [ TRUSTED ] [ PROCEDURAL ] LANGUAGE name
  3. HANDLER call_handler [ INLINE inline_handler ]
  4. [ VALIDATOR valfunction ]

See CREATE LANGUAGE for more information.

CREATE OPERATOR

定义一个新的运算符。

  1. CREATE OPERATOR name (
  2. PROCEDURE = funcname
  3. [, LEFTARG = lefttype] [, RIGHTARG = righttype]
  4. [, COMMUTATOR = com_op] [, NEGATOR = neg_op]
  5. [, RESTRICT = res_proc] [, JOIN = join_proc]
  6. [, HASHES] [, MERGES] )

See CREATE OPERATOR for more information.

CREATE OPERATOR CLASS

定义一个新的运算符类。

  1. CREATE OPERATOR CLASS name [DEFAULT] FOR TYPE data_type
  2. USING index_method [ FAMILY family_name ] AS
  3. { OPERATOR strategy_number operator_name [ ( op_type, op_type ) ] [ FOR SEARCH | FOR ORDER BY sort_family_name ]
  4. | FUNCTION support_number funcname (argument_type [, ...] )
  5. | STORAGE storage_type
  6. } [, ... ]

See CREATE OPERATOR CLASS for more information.

CREATE OPERATOR FAMILY

定义一个新的运算符族。

  1. CREATE OPERATOR FAMILY name USING index_method

See CREATE OPERATOR FAMILY for more information.

CREATE PROTOCOL

注册自定义数据访问协议,该协议可以在定义Greenplum数据库外部表时指定。

  1. CREATE [TRUSTED] PROTOCOL name (
  2. [readfunc='read_call_handler'] [, writefunc='write_call_handler']
  3. [, validatorfunc='validate_handler' ])

See CREATE PROTOCOL for more information.

CREATE RESOURCE GROUP

定义一个新的资源组。

  1. CREATE RESOURCE GROUP name WITH (group_attribute=value [, ... ])

See CREATE RESOURCE GROUP for more information.

CREATE RESOURCE QUEUE

定义一个新的资源队列。

  1. CREATE RESOURCE QUEUE name WITH (queue_attribute=value [, ... ])

See CREATE RESOURCE QUEUE for more information.

CREATE ROLE

定义一个新的数据库角色(用户或组)。

  1. CREATE ROLE name [[WITH] option [ ... ]]

See CREATE ROLE for more information.

CREATE RULE

定义新的重写规则。

  1. CREATE [OR REPLACE] RULE name AS ON event
  2. TO table_name [WHERE condition]
  3. DO [ALSO | INSTEAD] { NOTHING | command | (command; command
  4. ...) }

See CREATE RULE for more information.

CREATE SCHEMA

定义一个新的模式。

  1. CREATE SCHEMA schema_name [AUTHORIZATION username]
  2. [schema_element [ ... ]]
  3. CREATE SCHEMA AUTHORIZATION rolename [schema_element [ ... ]]
  4. CREATE SCHEMA IF NOT EXISTS schema_name [ AUTHORIZATION user_name ]
  5. CREATE SCHEMA IF NOT EXISTS AUTHORIZATION user_name

See CREATE SCHEMA for more information.

CREATE SEQUENCE

定义一个新的序列生成器。

  1. CREATE [TEMPORARY | TEMP] SEQUENCE name
  2. [INCREMENT [BY] value]
  3. [MINVALUE minvalue | NO MINVALUE]
  4. [MAXVALUE maxvalue | NO MAXVALUE]
  5. [START [ WITH ] start]
  6. [CACHE cache]
  7. [[NO] CYCLE]
  8. [OWNED BY { table.column | NONE }]

See CREATE SEQUENCE for more information.

CREATE SERVER

定义一个新的外部服务器。

  1. CREATE SERVER server_name [ TYPE 'server_type' ] [ VERSION 'server_version' ]
  2. FOREIGN DATA WRAPPER fdw_name
  3. [ OPTIONS ( [ mpp_execute { 'master' | 'any' | 'all segments' } [, ] ] option 'value' [, ... ] ) ]

See CREATE SERVER for more information.

CREATE TABLE

定义一个新表。

  1. CREATE [ [GLOBAL | LOCAL] {TEMPORARY | TEMP } | UNLOGGED] TABLE [IF NOT EXISTS]
  2. table_name (
  3. [ { column_name data_type [ COLLATE collation ] [column_constraint [ ... ] ]
  4. [ ENCODING ( storage_directive [, ...] ) ]
  5. | table_constraint
  6. | LIKE source_table [ like_option ... ] }
  7. | [ column_reference_storage_directive [, ...]
  8. [, ... ]
  9. ] )
  10. [ INHERITS ( parent_table [, ... ] ) ]
  11. [ WITH ( storage_parameter [=value] [, ... ] )
  12. | WITH OIDS | WITHOUT OIDS ]
  13. [ ON COMMIT { PRESERVE ROWS | DELETE ROWS | DROP } ]
  14. [ TABLESPACE tablespace_name ]
  15. [ DISTRIBUTED BY (column [opclass], [ ... ] )
  16. | DISTRIBUTED RANDOMLY | DISTRIBUTED REPLICATED ]
  17. [ PARTITION BY partition_type (column)
  18. [ SUBPARTITION BY partition_type (column) ]
  19. [ SUBPARTITION TEMPLATE ( template_spec ) ]
  20. [...]
  21. ( partition_spec )
  22. | [ SUBPARTITION BY partition_type (column) ]
  23. [...]
  24. ( partition_spec
  25. [ ( subpartition_spec
  26. [(...)]
  27. ) ]
  28. ) ]
  29. CREATE [ [GLOBAL | LOCAL] {TEMPORARY | TEMP} | UNLOGGED ] TABLE [IF NOT EXISTS]
  30. table_name
  31. OF type_name [ (
  32. { column_name WITH OPTIONS [ column_constraint [ ... ] ]
  33. | table_constraint }
  34. [, ... ]
  35. ) ]
  36. [ WITH ( storage_parameter [=value] [, ... ] ) | WITH OIDS | WITHOUT OIDS ]
  37. [ ON COMMIT { PRESERVE ROWS | DELETE ROWS | DROP } ]
  38. [ TABLESPACE tablespace_name ]

See CREATE TABLE for more information.

CREATE TABLE AS

根据查询结果定义一个新表。

  1. CREATE [ [ GLOBAL | LOCAL ] { TEMPORARY | TEMP } | UNLOGGED ] TABLE table_name
  2. [ (column_name [, ...] ) ]
  3. [ WITH ( storage_parameter [= value] [, ... ] ) | WITH OIDS | WITHOUT OIDS ]
  4. [ ON COMMIT { PRESERVE ROWS | DELETE ROWS | DROP } ]
  5. [ TABLESPACE tablespace_name ]
  6. AS query
  7. [ WITH [ NO ] DATA ]
  8. [ DISTRIBUTED BY (column [, ... ] ) | DISTRIBUTED RANDOMLY | DISTRIBUTED REPLICATED ]

See CREATE TABLE AS for more information.

CREATE TABLESPACE

定义一个新的表空间。

  1. CREATE TABLESPACE tablespace_name [OWNER username] LOCATION '/path/to/dir'
  2. [WITH (contentID_1='/path/to/dir1'[, contentID_2='/path/to/dir2' ... ])]

See CREATE TABLESPACE for more information.

CREATE TEXT SEARCH CONFIGURATION

定义新的文本搜索配置。

  1. CREATE TEXT SEARCH CONFIGURATION name (
  2. PARSER = parser_name |
  3. COPY = source_config
  4. )

See CREATE TEXT SEARCH CONFIGURATION for more information.

CREATE TEXT SEARCH DICTIONARY

定义一个新的文本搜索字典。

  1. CREATE TEXT SEARCH DICTIONARY name (
  2. TEMPLATE = template
  3. [, option = value [, ... ]]
  4. )

See CREATE TEXT SEARCH DICTIONARY for more information.

CREATE TEXT SEARCH PARSER

定义一个新的文本搜索解析器。

  1. CREATE TEXT SEARCH PARSER name (
  2. START = start_function ,
  3. GETTOKEN = gettoken_function ,
  4. END = end_function ,
  5. LEXTYPES = lextypes_function
  6. [, HEADLINE = headline_function ]
  7. )

See CREATE TEXT SEARCH PARSER for more information.

CREATE TEXT SEARCH TEMPLATE

定义一个新的文本搜索模板。

  1. CREATE TEXT SEARCH TEMPLATE name (
  2. [ INIT = init_function , ]
  3. LEXIZE = lexize_function
  4. )

See CREATE TEXT SEARCH TEMPLATE for more information.

CREATE TYPE

定义新的数据类型。

  1. CREATE TYPE name AS
  2. ( attribute_name data_type [ COLLATE collation ] [, ... ] ] )
  3. CREATE TYPE name AS ENUM
  4. ( [ 'label' [, ... ] ] )
  5. CREATE TYPE name AS RANGE (
  6. SUBTYPE = subtype
  7. [ , SUBTYPE_OPCLASS = subtype_operator_class ]
  8. [ , COLLATION = collation ]
  9. [ , CANONICAL = canonical_function ]
  10. [ , SUBTYPE_DIFF = subtype_diff_function ]
  11. )
  12. CREATE TYPE name (
  13. INPUT = input_function,
  14. OUTPUT = output_function
  15. [, RECEIVE = receive_function]
  16. [, SEND = send_function]
  17. [, TYPMOD_IN = type_modifier_input_function ]
  18. [, TYPMOD_OUT = type_modifier_output_function ]
  19. [, INTERNALLENGTH = {internallength | VARIABLE}]
  20. [, PASSEDBYVALUE]
  21. [, ALIGNMENT = alignment]
  22. [, STORAGE = storage]
  23. [, LIKE = like_type
  24. [, CATEGORY = category]
  25. [, PREFERRED = preferred]
  26. [, DEFAULT = default]
  27. [, ELEMENT = element]
  28. [, DELIMITER = delimiter]
  29. [, COLLATABLE = collatable]
  30. [, COMPRESSTYPE = compression_type]
  31. [, COMPRESSLEVEL = compression_level]
  32. [, BLOCKSIZE = blocksize] )
  33. CREATE TYPE name

See CREATE TYPE for more information.

CREATE USER

默认情况下,使用LOGIN特权定义一个新的数据库角色。

  1. CREATE USER name [[WITH] option [ ... ]]

See CREATE USER for more information.

CREATE USER MAPPING

定义用户到外部服务器的新映射。

  1. CREATE USER MAPPING FOR { username | USER | CURRENT_USER | PUBLIC }
  2. SERVER servername
  3. [ OPTIONS ( option 'value' [, ... ] ) ]

See CREATE USER MAPPING for more information.

CREATE VIEW

定义一个新的视图。

  1. CREATE [OR REPLACE] [TEMP | TEMPORARY] [RECURSIVE] VIEW name
  2. [ ( column_name [, ...] ) ]
  3. [ WITH ( view_option_name [= view_option_value] [, ... ] ) ]
  4. AS query
  5. [ WITH [ CASCADED | LOCAL ] CHECK OPTION ]

See CREATE VIEW for more information.

DEALLOCATE

取消分配预编译语句。

  1. DEALLOCATE [PREPARE] name

See DEALLOCATE for more information.

DECLARE

定义一个游标。

  1. DECLARE name [BINARY] [INSENSITIVE] [NO SCROLL] CURSOR
  2. [{WITH | WITHOUT} HOLD]
  3. FOR query [FOR READ ONLY]

See DECLARE for more information.

DELETE

从表中删除行。

  1. [ WITH [ RECURSIVE ] with_query [, ...] ]
  2. DELETE FROM [ONLY] table [[AS] alias]
  3. [USING usinglist]
  4. [WHERE condition | WHERE CURRENT OF cursor_name]
  5. [RETURNING * | output_expression [[AS] output_name] [, …]]

See DELETE for more information.

DISCARD

放弃会话状态。

  1. DISCARD { ALL | PLANS | TEMPORARY | TEMP }

See DISCARD for more information.

DROP AGGREGATE

删除聚合函数。

  1. DROP AGGREGATE [IF EXISTS] name ( type [, ...] ) [CASCADE | RESTRICT]

See DROP AGGREGATE for more information.

DO

执行匿名代码块作为临时匿名函数。

  1. DO [ LANGUAGE lang_name ] code

See DO for more information.

DROP CAST

删除一个造型。

  1. DROP CAST [IF EXISTS] (sourcetype AS targettype) [CASCADE | RESTRICT]

See DROP CAST for more information.

DROP COLLATION

删除以前定义的排序规则。

  1. DROP COLLATION [ IF EXISTS ] name [ CASCADE | RESTRICT ]

See DROP COLLATION for more information.

DROP CONVERSION

删除转换。

  1. DROP CONVERSION [IF EXISTS] name [CASCADE | RESTRICT]

See DROP CONVERSION for more information.

DROP DATABASE

删除数据库。

  1. DROP DATABASE [IF EXISTS] name

See DROP DATABASE for more information.

DROP DOMAIN

删除域。

  1. DROP DOMAIN [IF EXISTS] name [, ...] [CASCADE | RESTRICT]

See DROP DOMAIN for more information.

DROP EXTENSION

从Greenplum数据库中删除扩展。

  1. DROP EXTENSION [ IF EXISTS ] name [, ...] [ CASCADE | RESTRICT ]

See DROP EXTENSION for more information.

DROP EXTERNAL TABLE

删除外部表定义。

  1. DROP EXTERNAL [WEB] TABLE [IF EXISTS] name [CASCADE | RESTRICT]

See DROP EXTERNAL TABLE for more information.

DROP FOREIGN DATA WRAPPER

删除外部数据包装器。

  1. DROP FOREIGN DATA WRAPPER [ IF EXISTS ] name [ CASCADE | RESTRICT ]

See DROP FOREIGN DATA WRAPPER for more information.

DROP FOREIGN TABLE

删除外部表。

  1. DROP FOREIGN TABLE [ IF EXISTS ] name [, ...] [ CASCADE | RESTRICT ]

See DROP FOREIGN TABLE for more information.

DROP FUNCTION

删除函数。

  1. DROP FUNCTION [IF EXISTS] name ( [ [argmode] [argname] argtype
  2. [, ...] ] ) [CASCADE | RESTRICT]

See DROP FUNCTION for more information.

DROP GROUP

删除数据库角色。

  1. DROP GROUP [IF EXISTS] name [, ...]

See DROP GROUP for more information.

DROP INDEX

删除索引。

  1. DROP INDEX [ CONCURRENTLY ] [ IF EXISTS ] name [, ...] [ CASCADE | RESTRICT ]

See DROP INDEX for more information.

DROP LANGUAGE

删除过程语言。

  1. DROP [PROCEDURAL] LANGUAGE [IF EXISTS] name [CASCADE | RESTRICT]

See DROP LANGUAGE for more information.

DROP OPERATOR

删除运算符。

  1. DROP OPERATOR [IF EXISTS] name ( {lefttype | NONE} ,
  2. {righttype | NONE} ) [CASCADE | RESTRICT]

See DROP OPERATOR for more information.

DROP OPERATOR CLASS

删除运算符类。

  1. DROP OPERATOR CLASS [IF EXISTS] name USING index_method [CASCADE | RESTRICT]

See DROP OPERATOR CLASS for more information.

DROP OPERATOR FAMILY

删除一个运算符族

  1. DROP OPERATOR FAMILY [IF EXISTS] name USING index_method [CASCADE | RESTRICT]

See DROP OPERATOR FAMILY for more information.

DROP OWNED

删除数据库角色拥有的数据库对象。

  1. DROP OWNED BY name [, ...] [CASCADE | RESTRICT]

See DROP OWNED for more information.

DROP PROTOCOL

从数据库中删除外部表数据访问协议。

  1. DROP PROTOCOL [IF EXISTS] name

See DROP PROTOCOL for more information.

DROP RESOURCE GROUP

删除资源组。

  1. DROP RESOURCE GROUP group_name

See DROP RESOURCE GROUP for more information.

DROP RESOURCE QUEUE

删除资源队列。

  1. DROP RESOURCE QUEUE queue_name

See DROP RESOURCE QUEUE for more information.

DROP ROLE

删除数据库角色。

  1. DROP ROLE [IF EXISTS] name [, ...]

See DROP ROLE for more information.

DROP RULE

删除重写规则。

  1. DROP RULE [IF EXISTS] name ON table_name [CASCADE | RESTRICT]

See DROP RULE for more information.

DROP SCHEMA

删除模式。

  1. DROP SCHEMA [IF EXISTS] name [, ...] [CASCADE | RESTRICT]

See DROP SCHEMA for more information.

DROP SEQUENCE

删除序列。

  1. DROP SEQUENCE [IF EXISTS] name [, ...] [CASCADE | RESTRICT]

See DROP SEQUENCE for more information.

DROP SERVER

删除外部服务器描述符。

  1. DROP SERVER [ IF EXISTS ] servername [ CASCADE | RESTRICT ]

See DROP SERVER for more information.

DROP TABLE

删除表。

  1. DROP TABLE [IF EXISTS] name [, ...] [CASCADE | RESTRICT]

See DROP TABLE for more information.

DROP TABLESPACE

删除表空间。

  1. DROP TABLESPACE [IF EXISTS] tablespacename

See DROP TABLESPACE for more information.

DROP TEXT SEARCH CONFIGURATION

删除文本搜索配置。

  1. DROP TEXT SEARCH CONFIGURATION [ IF EXISTS ] name [ CASCADE | RESTRICT ]

See DROP TEXT SEARCH CONFIGURATION for more information.

DROP TEXT SEARCH DICTIONARY

删除文本搜索字典。

  1. DROP TEXT SEARCH DICTIONARY [ IF EXISTS ] name [ CASCADE | RESTRICT ]

See DROP TEXT SEARCH DICTIONARY for more information.

DROP TEXT SEARCH PARSER

删除文本搜索解析器。

  1. DROP TEXT SEARCH PARSER [ IF EXISTS ] name [ CASCADE | RESTRICT ]

See DROP TEXT SEARCH PARSER for more information.

DROP TEXT SEARCH TEMPLATE

删除文本搜索模板。

  1. DROP TEXT SEARCH TEMPLATE [ IF EXISTS ] name [ CASCADE | RESTRICT ]

See DROP TEXT SEARCH TEMPLATE for more information.

DROP TYPE

删除数据类型。

  1. DROP TYPE [IF EXISTS] name [, ...] [CASCADE | RESTRICT]

See DROP TYPE for more information.

DROP USER

删除数据库角色。

  1. DROP USER [IF EXISTS] name [, ...]

See DROP USER for more information.

DROP USER MAPPING

删除外部服务器的用户映射。

  1. DROP USER MAPPING [ IF EXISTS ] { username | USER | CURRENT_USER | PUBLIC }
  2. SERVER servername

See DROP USER MAPPING for more information.

DROP VIEW

删除视图。

  1. DROP VIEW [IF EXISTS] name [, ...] [CASCADE | RESTRICT]

See DROP VIEW for more information.

END

提交当前事务。

  1. END [WORK | TRANSACTION]

See END for more information.

EXECUTE

执行准备好的SQL语句。

  1. EXECUTE name [ (parameter [, ...] ) ]

See EXECUTE for more information.

EXPLAIN

显示语句的查询计划。

  1. EXPLAIN [ ( option [, ...] ) ] statement
  2. EXPLAIN [ANALYZE] [VERBOSE] statement

See EXPLAIN for more information.

FETCH

使用游标从查询中检索行。

  1. FETCH [ forward_direction { FROM | IN } ]
  2. cursor_name

See FETCH for more information.

GRANT

定义访问权限。

  1. GRANT { {SELECT | INSERT | UPDATE | DELETE | REFERENCES |
  2. TRIGGER | TRUNCATE } [, ...] | ALL [PRIVILEGES] }
  3. ON { [TABLE] table_name [, ...]
  4. | ALL TABLES IN SCHEMA schema_name [, ...] }
  5. TO { [ GROUP ] role_name | PUBLIC} [, ...] [ WITH GRANT OPTION ]
  6. GRANT { { SELECT | INSERT | UPDATE | REFERENCES } ( column_name [, ...] )
  7. [, ...] | ALL [ PRIVILEGES ] ( column_name [, ...] ) }
  8. ON [ TABLE ] table_name [, ...]
  9. TO { role_name | PUBLIC } [, ...] [ WITH GRANT OPTION ]
  10. GRANT { {USAGE | SELECT | UPDATE} [, ...] | ALL [PRIVILEGES] }
  11. ON { SEQUENCE sequence_name [, ...]
  12. | ALL SEQUENCES IN SCHEMA schema_name [, ...] }
  13. TO { [ GROUP ] role_name | PUBLIC } [, ...] [ WITH GRANT OPTION ]
  14. GRANT { {CREATE | CONNECT | TEMPORARY | TEMP} [, ...] | ALL
  15. [PRIVILEGES] }
  16. ON DATABASE database_name [, ...]
  17. TO { [ GROUP ] role_name | PUBLIC } [, ...] [ WITH GRANT OPTION ]
  18. GRANT { USAGE | ALL [ PRIVILEGES ] }
  19. ON DOMAIN domain_name [, ...]
  20. TO { [ GROUP ] role_name | PUBLIC } [, ...] [ WITH GRANT OPTION ]
  21. GRANT { USAGE | ALL [ PRIVILEGES ] }
  22. ON FOREIGN DATA WRAPPER fdw_name [, ...]
  23. TO { [ GROUP ] role_name | PUBLIC } [, ...] [ WITH GRANT OPTION ]
  24. GRANT { USAGE | ALL [ PRIVILEGES ] }
  25. ON FOREIGN SERVER server_name [, ...]
  26. TO { [ GROUP ] role_name | PUBLIC } [, ...] [ WITH GRANT OPTION ]
  27. GRANT { EXECUTE | ALL [PRIVILEGES] }
  28. ON { FUNCTION function_name ( [ [ argmode ] [ argname ] argtype [, ...]
  29. ] ) [, ...]
  30. | ALL FUNCTIONS IN SCHEMA schema_name [, ...] }
  31. TO { [ GROUP ] role_name | PUBLIC } [, ...] [ WITH GRANT OPTION ]
  32. GRANT { USAGE | ALL [PRIVILEGES] }
  33. ON LANGUAGE lang_name [, ...]
  34. TO { [ GROUP ] role_name | PUBLIC } [, ...] [ WITH GRANT OPTION ]
  35. GRANT { { CREATE | USAGE } [, ...] | ALL [PRIVILEGES] }
  36. ON SCHEMA schema_name [, ...]
  37. TO { [ GROUP ] role_name | PUBLIC} [, ...] [ WITH GRANT OPTION ]
  38. GRANT { CREATE | ALL [PRIVILEGES] }
  39. ON TABLESPACE tablespace_name [, ...]
  40. TO { [ GROUP ] role_name | PUBLIC } [, ...] [ WITH GRANT OPTION ]
  41. GRANT { USAGE | ALL [ PRIVILEGES ] }
  42. ON TYPE type_name [, ...]
  43. TO { [ GROUP ] role_name | PUBLIC } [, ...] [ WITH GRANT OPTION ]
  44. GRANT parent_role [, ...]
  45. TO member_role [, ...] [WITH ADMIN OPTION]
  46. GRANT { SELECT | INSERT | ALL [PRIVILEGES] }
  47. ON PROTOCOL protocolname
  48. TO username

See GRANT for more information.

INSERT

在表中创建新行。

  1. [ WITH [ RECURSIVE ] with_query [, ...] ]
  2. INSERT INTO table [( column [, ...] )]
  3. {DEFAULT VALUES | VALUES ( {expression | DEFAULT} [, ...] ) [, ...] | query}
  4. [RETURNING * | output_expression [[AS] output_name] [, ...]]

See INSERT for more information.

LOAD

加载或重新加载共享库文件。

  1. LOAD 'filename'

See LOAD for more information.

LOCK

锁表。

  1. LOCK [TABLE] [ONLY] name [ * ] [, ...] [IN lockmode MODE] [NOWAIT]

See LOCK for more information.

MOVE

定位游标。

  1. MOVE [ forward_direction [ FROM | IN ] ]
  2. cursor_name

See MOVE for more information.

PREPARE

准备要执行的语句。

  1. PREPARE name [ (datatype [, ...] ) ] AS statement

See PREPARE for more information.

REASSIGN OWNED

更改数据库角色拥有的数据库对象的所有权。

  1. REASSIGN OWNED BY old_role [, ...] TO new_role

See REASSIGN OWNED for more information.

REINDEX

重建索引。

  1. REINDEX {INDEX | TABLE | DATABASE | SYSTEM} name

See REINDEX for more information.

RELEASE SAVEPOINT

销毁先前定义的保存点。

  1. RELEASE [SAVEPOINT] savepoint_name

See RELEASE SAVEPOINT for more information.

RESET

将系统配置参数的值恢复为默认值。

  1. RESET configuration_parameter
  2. RESET ALL

See RESET for more information.

REVOKE

删除访问权限。

  1. REVOKE [GRANT OPTION FOR] { {SELECT | INSERT | UPDATE | DELETE
  2. | REFERENCES | TRIGGER | TRUNCATE } [, ...] | ALL [PRIVILEGES] }
  3. ON { [TABLE] table_name [, ...]
  4. | ALL TABLES IN SCHEMA schema_name [, ...] }
  5. FROM { [ GROUP ] role_name | PUBLIC} [, ...]
  6. [CASCADE | RESTRICT]
  7. REVOKE [ GRANT OPTION FOR ] { { SELECT | INSERT | UPDATE
  8. | REFERENCES } ( column_name [, ...] )
  9. [, ...] | ALL [ PRIVILEGES ] ( column_name [, ...] ) }
  10. ON [ TABLE ] table_name [, ...]
  11. FROM { [ GROUP ] role_name | PUBLIC } [, ...]
  12. [ CASCADE | RESTRICT ]
  13. REVOKE [GRANT OPTION FOR] { {USAGE | SELECT | UPDATE} [,...]
  14. | ALL [PRIVILEGES] }
  15. ON { SEQUENCE sequence_name [, ...]
  16. | ALL SEQUENCES IN SCHEMA schema_name [, ...] }
  17. FROM { [ GROUP ] role_name | PUBLIC } [, ...]
  18. [CASCADE | RESTRICT]
  19. REVOKE [GRANT OPTION FOR] { {CREATE | CONNECT
  20. | TEMPORARY | TEMP} [, ...] | ALL [PRIVILEGES] }
  21. ON DATABASE database_name [, ...]
  22. FROM { [ GROUP ] role_name | PUBLIC} [, ...]
  23. [CASCADE | RESTRICT]
  24. REVOKE [ GRANT OPTION FOR ]
  25. { USAGE | ALL [ PRIVILEGES ] }
  26. ON DOMAIN domain_name [, ...]
  27. FROM { [ GROUP ] role_name | PUBLIC } [, ...]
  28. [ CASCADE | RESTRICT ]
  29. REVOKE [ GRANT OPTION FOR ]
  30. { USAGE | ALL [ PRIVILEGES ] }
  31. ON FOREIGN DATA WRAPPER fdw_name [, ...]
  32. FROM { [ GROUP ] role_name | PUBLIC } [, ...]
  33. [ CASCADE | RESTRICT ]
  34. REVOKE [ GRANT OPTION FOR ]
  35. { USAGE | ALL [ PRIVILEGES ] }
  36. ON FOREIGN SERVER server_name [, ...]
  37. FROM { [ GROUP ] role_name | PUBLIC } [, ...]
  38. [ CASCADE | RESTRICT ]
  39. REVOKE [GRANT OPTION FOR] {EXECUTE | ALL [PRIVILEGES]}
  40. ON { FUNCTION funcname ( [[argmode] [argname] argtype
  41. [, ...]] ) [, ...]
  42. | ALL FUNCTIONS IN SCHEMA schema_name [, ...] }
  43. FROM { [ GROUP ] role_name | PUBLIC} [, ...]
  44. [CASCADE | RESTRICT]
  45. REVOKE [GRANT OPTION FOR] {USAGE | ALL [PRIVILEGES]}
  46. ON LANGUAGE langname [, ...]
  47. FROM { [ GROUP ] role_name | PUBLIC} [, ...]
  48. [ CASCADE | RESTRICT ]
  49. REVOKE [GRANT OPTION FOR] { {CREATE | USAGE} [, ...]
  50. | ALL [PRIVILEGES] }
  51. ON SCHEMA schema_name [, ...]
  52. FROM { [ GROUP ] role_name | PUBLIC} [, ...]
  53. [CASCADE | RESTRICT]
  54. REVOKE [GRANT OPTION FOR] { CREATE | ALL [PRIVILEGES] }
  55. ON TABLESPACE tablespacename [, ...]
  56. FROM { [ GROUP ] role_name | PUBLIC } [, ...]
  57. [CASCADE | RESTRICT]
  58. REVOKE [ GRANT OPTION FOR ]
  59. { USAGE | ALL [ PRIVILEGES ] }
  60. ON TYPE type_name [, ...]
  61. FROM { [ GROUP ] role_name | PUBLIC } [, ...]
  62. [ CASCADE | RESTRICT ]
  63. REVOKE [ADMIN OPTION FOR] parent_role [, ...]
  64. FROM [ GROUP ] member_role [, ...]
  65. [CASCADE | RESTRICT]

See REVOKE for more information.

ROLLBACK

中止当前事务。

  1. ROLLBACK [WORK | TRANSACTION]

See ROLLBACK for more information.

ROLLBACK TO SAVEPOINT

将当前事务回滚到保存点。

  1. ROLLBACK [WORK | TRANSACTION] TO [SAVEPOINT]
  2. savepoint_name

See ROLLBACK TO SAVEPOINT for more information.

SAVEPOINT

在当前事务中定义一个新的保存点。

  1. SAVEPOINT savepoint_name

See SAVEPOINT for more information.

SELECT

从表或视图中检索行。

  1. [ WITH [ RECURSIVE1 ] with_query [, ...] ]
  2. SELECT [ALL | DISTINCT [ON (expression [, ...])]]
  3. * | expression[[AS] output_name] [, ...]
  4. [FROM from_item [, ...]]
  5. [WHERE condition]
  6. [GROUP BY grouping_element [, ...]]
  7. [HAVING condition [, ...]]
  8. [WINDOW window_name AS (window_definition) [, ...] ]
  9. [{UNION | INTERSECT | EXCEPT} [ALL | DISTINCT] select]
  10. [ORDER BY expression [ASC | DESC | USING operator] [NULLS {FIRST | LAST}] [, ...]]
  11. [LIMIT {count | ALL}]
  12. [OFFSET start [ ROW | ROWS ] ]
  13. [FETCH { FIRST | NEXT } [ count ] { ROW | ROWS } ONLY]
  14. [FOR {UPDATE | NO KEY UPDATE | SHARE | KEY SHARE} [OF table_name [, ...]] [NOWAIT] [...]]
  15. TABLE { [ ONLY ] table_name [ * ] | with_query_name }

See SELECT for more information.

SELECT INTO

根据查询结果定义一个新表。

  1. [ WITH [ RECURSIVE ] with_query [, ...] ]
  2. SELECT [ALL | DISTINCT [ON ( expression [, ...] )]]
  3. * | expression [AS output_name] [, ...]
  4. INTO [TEMPORARY | TEMP | UNLOGGED ] [TABLE] new_table
  5. [FROM from_item [, ...]]
  6. [WHERE condition]
  7. [GROUP BY expression [, ...]]
  8. [HAVING condition [, ...]]
  9. [{UNION | INTERSECT | EXCEPT} [ALL | DISTINCT ] select]
  10. [ORDER BY expression [ASC | DESC | USING operator] [NULLS {FIRST | LAST}] [, ...]]
  11. [LIMIT {count | ALL}]
  12. [OFFSET start [ ROW | ROWS ] ]
  13. [FETCH { FIRST | NEXT } [ count ] { ROW | ROWS } ONLY ]
  14. [FOR {UPDATE | SHARE} [OF table_name [, ...]] [NOWAIT]
  15. [...]]

See SELECT INTO for more information.

SET

更改Greenplum数据库配置参数的值。

  1. SET [SESSION | LOCAL] configuration_parameter {TO | =} value | 'value' | DEFAULT}
  2. SET [SESSION | LOCAL] TIME ZONE {timezone | LOCAL | DEFAULT}

See SET for more information.

SET CONSTRAINTS

设置当前事务的约束检查时间。

  1. SET CONSTRAINTS { ALL | name [, ...] } { DEFERRED | IMMEDIATE }

See SET CONSTRAINTS for more information.

SET ROLE

设置当前会话的当前角色标识符。

  1. SET [SESSION | LOCAL] ROLE rolename
  2. SET [SESSION | LOCAL] ROLE NONE
  3. RESET ROLE

See SET ROLE for more information.

SET SESSION AUTHORIZATION

设置会话角色标识符和当前会话的当前角色标识符。

  1. SET [SESSION | LOCAL] SESSION AUTHORIZATION rolename
  2. SET [SESSION | LOCAL] SESSION AUTHORIZATION DEFAULT
  3. RESET SESSION AUTHORIZATION

See SET SESSION AUTHORIZATION for more information.

SET TRANSACTION

设置当前事务的特性。

  1. SET TRANSACTION [transaction_mode] [READ ONLY | READ WRITE]
  2. SET TRANSACTION SNAPSHOT snapshot_id
  3. SET SESSION CHARACTERISTICS AS TRANSACTION transaction_mode
  4. [READ ONLY | READ WRITE]
  5. [NOT] DEFERRABLE

See SET TRANSACTION for more information.

SHOW

显示系统配置参数的值。

  1. SHOW configuration_parameter
  2. SHOW ALL

See SHOW for more information.

START TRANSACTION

启动事务块。

  1. START TRANSACTION [transaction_mode] [READ WRITE | READ ONLY]

See START TRANSACTION for more information.

TRUNCATE

清空表的所有行。

  1. TRUNCATE [TABLE] [ONLY] name [ * ] [, ...]
  2. [ RESTART IDENTITY | CONTINUE IDENTITY ] [CASCADE | RESTRICT]

See TRUNCATE for more information.

UPDATE

更新表的行。

  1. [ WITH [ RECURSIVE ] with_query [, ...] ]
  2. UPDATE [ONLY] table [[AS] alias]
  3. SET {column = {expression | DEFAULT} |
  4. (column [, ...]) = ({expression | DEFAULT} [, ...])} [, ...]
  5. [FROM fromlist]
  6. [WHERE condition| WHERE CURRENT OF cursor_name ]

See UPDATE for more information.

VACUUM

垃圾收集并可选地分析数据库。

  1. VACUUM [({ FULL | FREEZE | VERBOSE | ANALYZE } [, ...])] [table [(column [, ...] )]]
  2. VACUUM [FULL] [FREEZE] [VERBOSE] [table]
  3. VACUUM [FULL] [FREEZE] [VERBOSE] ANALYZE
  4. [table [(column [, ...] )]]

See VACUUM for more information.

VALUES

计算一组行。

  1. VALUES ( expression [, ...] ) [, ...]
  2. [ORDER BY sort_expression [ ASC | DESC | USING operator ] [, ...]
  3. ]
  4. [LIMIT { count | ALL } ]
  5. [OFFSET start [ ROW | ROWS ] ]
  6. [FETCH { FIRST | NEXT } [count ] { ROW | ROWS } ONLY ]

See VALUES for more information.

Parent topic: SQL Command Reference