ABORT

Terminates the current transaction.

  1. ABORT [WORK | TRANSACTION]

See ABORT for more information.

ALTER AGGREGATE

Changes the definition of an aggregate function

  1. ALTER AGGREGATE <name> ( <aggregate_signature> ) RENAME TO <new_name>
  2. ALTER AGGREGATE <name> ( <aggregate_signature> ) OWNER TO <new_owner>
  3. ALTER AGGREGATE <name> ( <aggregate_signature> ) SET SCHEMA <new_schema>

See ALTER AGGREGATE for more information.

ALTER COLLATION

Changes the definition of a 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

Changes the definition of a 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

Changes the attributes of a 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

Changes default access 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

Changes the definition of a 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

Change the definition of an extension that is registered in a Greenplum database.

  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. * |
  34. [ <argmode> ] [ <argname> ] <argtype> [ , ... ] |
  35. [ [ <argmode> ] [ <argname> ] <argtype> [ , ... ] ] ORDER BY [ <argmode> ] [ <argname> ] <argtype> [ , ... ]

See ALTER EXTENSION for more information.

ALTER EXTERNAL TABLE

Changes the definition of an 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

Changes the definition of a 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

Changes the definition of a 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

Changes the definition of a 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

Changes a role name or membership.

  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

Changes the definition of an 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

Changes the name of a procedural language.

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

See ALTER LANGUAGE for more information.

ALTER MATERIALIZED VIEW

Changes the definition of a materialized view.

  1. ALTER MATERIALIZED VIEW [ IF EXISTS ] <name> <action> [, ... ]
  2. ALTER MATERIALIZED VIEW [ IF EXISTS ] <name>
  3. RENAME [ COLUMN ] <column_name> TO <new_column_name>
  4. ALTER MATERIALIZED VIEW [ IF EXISTS ] <name>
  5. RENAME TO <new_name>
  6. ALTER MATERIALIZED VIEW [ IF EXISTS ] <name>
  7. SET SCHEMA <new_schema>
  8. ALTER MATERIALIZED VIEW ALL IN TABLESPACE <name> [ OWNED BY <role_name> [, ... ] ]
  9. SET TABLESPACE <new_tablespace> [ NOWAIT ]
  10. where <action> is one of:
  11. ALTER [ COLUMN ] <column_name> SET STATISTICS <integer>
  12. ALTER [ COLUMN ] <column_name> SET ( <attribute_option> = <value> [, ... ] )
  13. ALTER [ COLUMN ] <column_name> RESET ( <attribute_option> [, ... ] )
  14. ALTER [ COLUMN ] <column_name> SET STORAGE { PLAIN | EXTERNAL | EXTENDED | MAIN }
  15. CLUSTER ON <index_name>
  16. SET WITHOUT CLUSTER
  17. SET ( <storage_paramete>r = <value> [, ... ] )
  18. RESET ( <storage_parameter> [, ... ] )
  19. OWNER TO <new_owner>

See ALTER MATERIALIZED VIEW for more information.

ALTER OPERATOR

Changes the definition of an 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

Changes the definition of an 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

Changes the definition of an 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

Changes the definition of a protocol.

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

See ALTER PROTOCOL for more information.

ALTER RESOURCE GROUP

Changes the limits of a resource group.

  1. ALTER RESOURCE GROUP <name> SET <group_attribute> <value>

See ALTER RESOURCE GROUP for more information.

ALTER RESOURCE QUEUE

Changes the limits of a resource queue.

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

See ALTER RESOURCE QUEUE for more information.

ALTER ROLE

Changes a database role (user or group).

  1. ALTER ROLE <name> [ [ WITH ] <option> [ ... ] ]
  2. where <option> can be:
  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

Changes the definition of a rule.

  1. ALTER RULE name ON table\_name RENAME TO new\_name

See ALTER RULE for more information.

ALTER SCHEMA

Changes the definition of a schema.

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

See ALTER SCHEMA for more information.

ALTER SEQUENCE

Changes the definition of a sequence generator.

  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

Changes the definition of a foreign 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

Changes the definition of a 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. where <action> is one of:
  22. ADD [COLUMN] <column_name data_type> [ DEFAULT <default_expr> ]
  23. [<column_constraint> [ ... ]]
  24. [ COLLATE <collation> ]
  25. [ ENCODING ( <storage_parameter> [,...] ) ]
  26. DROP [COLUMN] [IF EXISTS] <column_name> [RESTRICT | CASCADE]
  27. ALTER [COLUMN] <column_name> [ SET DATA ] TYPE <type> [COLLATE <collation>] [USING <expression>]
  28. ALTER [COLUMN] <column_name> SET DEFAULT <expression>
  29. ALTER [COLUMN] <column_name> DROP DEFAULT
  30. ALTER [COLUMN] <column_name> { SET | DROP } NOT NULL
  31. ALTER [COLUMN] <column_name> SET STATISTICS <integer>
  32. ALTER [COLUMN] column SET ( <attribute_option> = <value> [, ... ] )
  33. ALTER [COLUMN] column RESET ( <attribute_option> [, ... ] )
  34. ADD <table_constraint> [NOT VALID]
  35. ADD <table_constraint_using_index>
  36. VALIDATE CONSTRAINT <constraint_name>
  37. DROP CONSTRAINT [IF EXISTS] <constraint_name> [RESTRICT | CASCADE]
  38. DISABLE TRIGGER [<trigger_name> | ALL | USER]
  39. ENABLE TRIGGER [<trigger_name> | ALL | USER]
  40. CLUSTER ON <index_name>
  41. SET WITHOUT CLUSTER
  42. SET WITHOUT OIDS
  43. SET (<storage_parameter> = <value>)
  44. RESET (<storage_parameter> [, ... ])
  45. INHERIT <parent_table>
  46. NO INHERIT <parent_table>
  47. OF `type_name`
  48. NOT OF
  49. OWNER TO <new_owner>
  50. SET TABLESPACE <new_tablespace>

See ALTER TABLE for more information.

ALTER TABLESPACE

Changes the definition of a 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

Changes the definition of a 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

Changes the definition of a 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

Changes the definition of a 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

Changes the definition of a 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

Changes the definition of a data 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. where <action> is one of:
  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

Changes the definition of a database role (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

Changes the definition of a user mapping for a foreign server.

  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

Changes properties of a 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

Collects statistics about a database.

  1. ANALYZE [VERBOSE] [<table> [ (<column> [, ...] ) ]]
  2. ANALYZE [VERBOSE] {<root_partition_table_name>|<leaf_partition_table_name>} [ (<column> [, ...] )]
  3. ANALYZE [VERBOSE] ROOTPARTITION {ALL | <root_partition_table_name> [ (<column> [, ...] )]}

See ANALYZE for more information.

BEGIN

Starts a transaction block.

  1. BEGIN [WORK | TRANSACTION] [<transaction_mode>]

See BEGIN for more information.

CHECKPOINT

Forces a transaction log checkpoint.

  1. CHECKPOINT

See CHECKPOINT for more information.

CLOSE

Closes a cursor.

  1. CLOSE <cursor_name>

See CLOSE for more information.

CLUSTER

Physically reorders a heap storage table on disk according to an index. Not a recommended operation in Greenplum Database.

  1. CLUSTER <indexname> ON <tablename>
  2. CLUSTER [VERBOSE] <tablename> [ USING index_name ]
  3. CLUSTER [VERBOSE]

See CLUSTER for more information.

COMMENT

Defines or changes the comment of an object.

  1. COMMENT ON
  2. { TABLE <object_name> |
  3. COLUMN <relation_name.column_name> |
  4. AGGREGATE <agg_name> (<agg_signature>) |
  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. MATERIALIZED VIEW <object_name> |
  18. OPERATOR <operator_name> (<left_type>, <right_type>) |
  19. OPERATOR CLASS <object_name> USING <index_method> |
  20. [PROCEDURAL] LANGUAGE <object_name> |
  21. RESOURCE GROUP <object_name> |
  22. RESOURCE QUEUE <object_name> |
  23. ROLE <object_name> |
  24. RULE <rule_name> ON <table_name> |
  25. SCHEMA <object_name> |
  26. SEQUENCE <object_name> |
  27. SERVER <object_name> |
  28. TABLESPACE <object_name> |
  29. TEXT SEARCH CONFIGURATION <object_name> |
  30. TEXT SEARCH DICTIONARY <object_name> |
  31. TEXT SEARCH PARSER <object_name> |
  32. TEXT SEARCH TEMPLATE <object_name> |
  33. TRIGGER <trigger_name> ON <table_name> |
  34. TYPE <object_name> |
  35. VIEW <object_name> }
  36. IS '<text>'

See COMMENT for more information.

COMMIT

Commits the current transaction.

  1. COMMIT [WORK | TRANSACTION]

See COMMIT for more information.

COPY

Copies data between a file and a table.

  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

Defines a new aggregate function.

  1. CREATE AGGREGATE <name> ( [ <argmode> ] [ <argname> ] <arg_data_type> [ , ... ] ) (
  2. SFUNC = <statefunc>,
  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 = <statefunc>,
  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 = <statefunc>,
  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

Defines a new 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

Defines a new collation using the specified operating system locale settings, or by copying an existing 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

Defines a new encoding conversion.

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

See CREATE CONVERSION for more information.

CREATE DATABASE

Creates a new 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

Defines a new 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

Defines a new 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> | config_server=<url>]')
  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 [PERSISTENTLY]] 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 [PERSISTENTLY]] 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> | config_server=<url>]')
  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

Defines a new 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

Defines a new 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

Defines a new 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. | NO SQL | CONTAINS SQL | READS SQL DATA | MODIFIES SQL
  10. | [EXTERNAL] SECURITY INVOKER | [EXTERNAL] SECURITY DEFINER
  11. | EXECUTE ON { ANY | MASTER | ALL SEGMENTS | INITPLAN }
  12. | COST <execution_cost>
  13. | SET <configuration_parameter> { TO <value> | = <value> | FROM CURRENT }
  14. | AS '<definition>'
  15. | AS '<obj_file>', '<link_symbol>' } ...
  16. [ WITH ({ DESCRIBE = describe_function
  17. } [, ...] ) ]

See CREATE FUNCTION for more information.

CREATE GROUP

Defines a new database role.

CREATE GROUP <name> [[WITH] <option> [ ... ]]

See CREATE GROUP for more information.

CREATE INDEX

Defines a new index.

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

See CREATE INDEX for more information.

CREATE LANGUAGE

Defines a new procedural language.

CREATE [ OR REPLACE ] [ PROCEDURAL ] LANGUAGE <name>

CREATE [ OR REPLACE ] [ TRUSTED ] [ PROCEDURAL ] LANGUAGE <name>
    HANDLER <call_handler> [ INLINE <inline_handler> ] 
   [ VALIDATOR <valfunction> ]

See CREATE LANGUAGE for more information.

CREATE MATERIALIZED VIEW

Defines a new materialized view.

CREATE MATERIALIZED VIEW <table_name>
    [ (<column_name> [, ...] ) ]
    [ WITH ( <storage_parameter> [= <value>] [, ... ] ) ]
    [ TABLESPACE <tablespace_name> ]
    AS <query>
    [ WITH [ NO ] DATA ]
    [DISTRIBUTED {| BY <column> [<opclass>], [ ... ] | RANDOMLY | REPLICATED }]

See CREATE MATERIALIZED VIEW for more information.

CREATE OPERATOR

Defines a new operator.

CREATE OPERATOR <name> ( 
       PROCEDURE = <funcname>
       [, LEFTARG = <lefttype>] [, RIGHTARG = <righttype>]
       [, COMMUTATOR = <com_op>] [, NEGATOR = <neg_op>]
       [, RESTRICT = <res_proc>] [, JOIN = <join_proc>]
       [, HASHES] [, MERGES] )

See CREATE OPERATOR for more information.

CREATE OPERATOR CLASS

Defines a new operator class.

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

See CREATE OPERATOR CLASS for more information.

CREATE OPERATOR FAMILY

Defines a new operator family.

CREATE OPERATOR FAMILY <name>  USING <index_method>

See CREATE OPERATOR FAMILY for more information.

CREATE PROTOCOL

Registers a custom data access protocol that can be specified when defining a Greenplum Database external table.

CREATE [TRUSTED] PROTOCOL <name> (
   [readfunc='<read_call_handler>'] [, writefunc='<write_call_handler>']
   [, validatorfunc='<validate_handler>' ])

See CREATE PROTOCOL for more information.

CREATE RESOURCE GROUP

Defines a new resource group.

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

See CREATE RESOURCE GROUP for more information.

CREATE RESOURCE QUEUE

Defines a new resource queue.

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

See CREATE RESOURCE QUEUE for more information.

CREATE ROLE

Defines a new database role (user or group).

CREATE ROLE <name> [[WITH] <option> [ ... ]]

See CREATE ROLE for more information.

CREATE RULE

Defines a new rewrite rule.

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

See CREATE RULE for more information.

CREATE SCHEMA

Defines a new schema.

CREATE SCHEMA <schema_name> [AUTHORIZATION <username>] 
   [<schema_element> [ ... ]]

CREATE SCHEMA AUTHORIZATION <rolename> [<schema_element> [ ... ]]

CREATE SCHEMA IF NOT EXISTS <schema_name> [ AUTHORIZATION <user_name> ]

CREATE SCHEMA IF NOT EXISTS AUTHORIZATION <user_name>

See CREATE SCHEMA for more information.

CREATE SEQUENCE

Defines a new sequence generator.

CREATE [TEMPORARY | TEMP] SEQUENCE <name>
       [INCREMENT [BY] <value>] 
       [MINVALUE <minvalue> | NO MINVALUE] 
       [MAXVALUE <maxvalue> | NO MAXVALUE] 
       [START [ WITH ] <start>] 
       [CACHE <cache>] 
       [[NO] CYCLE] 
       [OWNED BY { <table>.<column> | NONE }]

See CREATE SEQUENCE for more information.

CREATE SERVER

Defines a new foreign server.

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

See CREATE SERVER for more information.

CREATE TABLE

Defines a new table.


CREATE [ [GLOBAL | LOCAL] {TEMPORARY | TEMP } | UNLOGGED] TABLE [IF NOT EXISTS] 
  <table_name> ( 
  [ { <column_name> <data_type> [ COLLATE <collation> ] [<column_constraint> [ ... ] ]
[ ENCODING ( <storage_directive> [, ...] ) ]
    | <table_constraint>
    | LIKE <source_table> [ <like_option> ... ] }
    | [ <column_reference_storage_directive> [, ...]
    [, ... ]
] )
[ INHERITS ( <parent_table> [, ... ] ) ]
[ WITH ( <storage_parameter> [=<value>] [, ... ] ) ]
[ ON COMMIT { PRESERVE ROWS | DELETE ROWS | DROP } ]
[ TABLESPACE <tablespace_name> ]
[ DISTRIBUTED BY (<column> [<opclass>], [ ... ] ) 
       | DISTRIBUTED RANDOMLY | DISTRIBUTED REPLICATED ]

{ --partitioned table using SUBPARTITION TEMPLATE
[ PARTITION BY <partition_type> (<column>) 
  {  [ SUBPARTITION BY <partition_type> (<column1>) 
       SUBPARTITION TEMPLATE ( <template_spec> ) ]
          [ SUBPARTITION BY partition_type (<column2>) 
            SUBPARTITION TEMPLATE ( <template_spec> ) ]
              [...]  }
  ( <partition_spec> ) ]
} |

{ **-- partitioned table without SUBPARTITION TEMPLATE
**[ PARTITION BY <partition_type> (<column>)
   [ SUBPARTITION BY <partition_type> (<column1>) ]
      [ SUBPARTITION BY <partition_type> (<column2>) ]
         [...]
  ( <partition_spec>
     [ ( <subpartition_spec_column1>
          [ ( <subpartition_spec_column2>
               [...] ) ] ) ],
  [ <partition_spec>
     [ ( <subpartition_spec_column1>
        [ ( <subpartition_spec_column2>
             [...] ) ] ) ], ]
    [...]
  ) ]
}

CREATE [ [GLOBAL | LOCAL] {TEMPORARY | TEMP} | UNLOGGED ] TABLE [IF NOT EXISTS] 
   <table_name>
    OF <type_name> [ (
  { <column_name> WITH OPTIONS [ <column_constraint> [ ... ] ]
    | <table_constraint> } 
    [, ... ]
) ]
[ WITH ( <storage_parameter> [=<value>] [, ... ] ) ]
[ ON COMMIT { PRESERVE ROWS | DELETE ROWS | DROP } ]
[ TABLESPACE <tablespace_name> ]

See CREATE TABLE for more information.

CREATE TABLE AS

Defines a new table from the results of a query.

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

See CREATE TABLE AS for more information.

CREATE TABLESPACE

Defines a new tablespace.

CREATE TABLESPACE <tablespace_name> [OWNER <username>]  LOCATION '</path/to/dir>' 
   [WITH (content<ID_1>='</path/to/dir1>'[, content<ID_2>='</path/to/dir2>' ... ])]

See CREATE TABLESPACE for more information.

CREATE TEXT SEARCH CONFIGURATION

Defines a new text search configuration.

CREATE TEXT SEARCH CONFIGURATION <name> (
    PARSER = <parser_name> |
    COPY = <source_config>
)

See CREATE TEXT SEARCH CONFIGURATION for more information.

CREATE TEXT SEARCH DICTIONARY

Defines a new text search dictionary.

CREATE TEXT SEARCH DICTIONARY <name> (
    TEMPLATE = <template>
    [, <option> = <value> [, ... ]]
)

See CREATE TEXT SEARCH DICTIONARY for more information.

CREATE TEXT SEARCH PARSER

Defines a new text search parser.

CREATE TEXT SEARCH PARSER name (
    START = start_function ,
    GETTOKEN = gettoken_function ,
    END = end_function ,
    LEXTYPES = lextypes_function
    [, HEADLINE = headline_function ]
)

See CREATE TEXT SEARCH PARSER for more information.

CREATE TEXT SEARCH TEMPLATE

Defines a new text search template.

CREATE TEXT SEARCH TEMPLATE <name> (
    [ INIT = <init_function> , ]
    LEXIZE = <lexize_function>
)

See CREATE TEXT SEARCH TEMPLATE for more information.

CREATE TYPE

Defines a new data type.

CREATE TYPE <name> AS 
    ( <attribute_name> <data_type> [ COLLATE <collation> ] [, ... ] ] )

CREATE TYPE <name> AS ENUM 
    ( [ '<label>' [, ... ] ] )

CREATE TYPE <name> AS RANGE (
    SUBTYPE = <subtype>
    [ , SUBTYPE_OPCLASS = <subtype_operator_class> ]
    [ , COLLATION = <collation> ]
    [ , CANONICAL = <canonical_function> ]
    [ , SUBTYPE_DIFF = <subtype_diff_function> ]
)

CREATE TYPE <name> (
    INPUT = <input_function>,
    OUTPUT = <output_function>
    [, RECEIVE = <receive_function>]
    [, SEND = <send_function>]
    [, TYPMOD_IN = <type_modifier_input_function> ]
    [, TYPMOD_OUT = <type_modifier_output_function> ]
    [, INTERNALLENGTH = {<internallength> | VARIABLE}]
    [, PASSEDBYVALUE]
    [, ALIGNMENT = <alignment>]
    [, STORAGE = <storage>]
    [, LIKE = <like_type>
    [, CATEGORY = <category>]
    [, PREFERRED = <preferred>]
    [, DEFAULT = <default>]
    [, ELEMENT = <element>]
    [, DELIMITER = <delimiter>]
    [, COLLATABLE = <collatable>]
    [, COMPRESSTYPE = <compression_type>]
    [, COMPRESSLEVEL = <compression_level>]
    [, BLOCKSIZE = <blocksize>] )

CREATE TYPE <name>

See CREATE TYPE for more information.

CREATE USER

Defines a new database role with the LOGIN privilege by default.

CREATE USER <name> [[WITH] <option> [ ... ]]

See CREATE USER for more information.

CREATE USER MAPPING

Defines a new mapping of a user to a foreign server.

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

See CREATE USER MAPPING for more information.

CREATE VIEW

Defines a new view.

CREATE [OR REPLACE] [TEMP | TEMPORARY] [RECURSIVE] VIEW <name> [ ( <column_name> [, ...] ) ]
    [ WITH ( view_option_name [= view_option_value] [, ... ] ) ]
    AS <query>
    [ WITH [ CASCADED | LOCAL ] CHECK OPTION ]

See CREATE VIEW for more information.

DEALLOCATE

Deallocates a prepared statement.

DEALLOCATE [PREPARE] <name>

See DEALLOCATE for more information.

DECLARE

Defines a cursor.

DECLARE <name> [BINARY] [INSENSITIVE] [NO SCROLL] [PARALLEL RETRIEVE] CURSOR 
     [{WITH | WITHOUT} HOLD] 
     FOR <query> [FOR READ ONLY]

See DECLARE for more information.

DELETE

Deletes rows from a table.

[ WITH [ RECURSIVE ] <with_query> [, ...] ]
DELETE FROM [ONLY] <table> [[AS] <alias>]
      [USING <usinglist>]
      [WHERE <condition> | WHERE CURRENT OF <cursor_name>]
      [RETURNING * | <output_expression> [[AS] <output_name>] [, …]]

See DELETE for more information.

DISCARD

Discards the session state.

DISCARD { ALL | PLANS | TEMPORARY | TEMP }

See DISCARD for more information.

DROP AGGREGATE

Removes an aggregate function.

DROP AGGREGATE [IF EXISTS] <name> ( <aggregate_signature> ) [CASCADE | RESTRICT]

See DROP AGGREGATE for more information.

DO

Runs anonymous code block as a transient anonymous function.

DO [ LANGUAGE <lang_name> ] <code>

See DO for more information.

DROP CAST

Removes a cast.

DROP CAST [IF EXISTS] (<sourcetype> AS <targettype>) [CASCADE | RESTRICT]

See DROP CAST for more information.

DROP COLLATION

Removes a previously defined collation.

DROP COLLATION [ IF EXISTS ] <name> [ CASCADE | RESTRICT ]

See DROP COLLATION for more information.

DROP CONVERSION

Removes a conversion.

DROP CONVERSION [IF EXISTS] <name> [CASCADE | RESTRICT]

See DROP CONVERSION for more information.

DROP DATABASE

Removes a database.

DROP DATABASE [IF EXISTS] <name>

See DROP DATABASE for more information.

DROP DOMAIN

Removes a domain.

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

See DROP DOMAIN for more information.

DROP EXTENSION

Removes an extension from a Greenplum database.

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

See DROP EXTENSION for more information.

DROP EXTERNAL TABLE

Removes an external table definition.

DROP EXTERNAL [WEB] TABLE [IF EXISTS] <name> [CASCADE | RESTRICT]

See DROP EXTERNAL TABLE for more information.

DROP FOREIGN DATA WRAPPER

Removes a foreign-data wrapper.

DROP FOREIGN DATA WRAPPER [ IF EXISTS ] <name> [ CASCADE | RESTRICT ]

See DROP FOREIGN DATA WRAPPER for more information.

DROP FOREIGN TABLE

Removes a foreign table.

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

See DROP FOREIGN TABLE for more information.

DROP FUNCTION

Removes a function.

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

See DROP FUNCTION for more information.

DROP GROUP

Removes a database role.

DROP GROUP [IF EXISTS] <name> [, ...]

See DROP GROUP for more information.

DROP INDEX

Removes an index.

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

See DROP INDEX for more information.

DROP LANGUAGE

Removes a procedural language.

DROP [PROCEDURAL] LANGUAGE [IF EXISTS] <name> [CASCADE | RESTRICT]

See DROP LANGUAGE for more information.

DROP MATERIALIZED VIEW

Removes a materialized view.

DROP MATERIALIZED VIEW [ IF EXISTS ] <name> [, ...] [ CASCADE | RESTRICT ]

See DROP MATERIALIZED VIEW for more information.

DROP OPERATOR

Removes an operator.

DROP OPERATOR [IF EXISTS] <name> ( {<lefttype> | NONE} , 
    {<righttype> | NONE} ) [CASCADE | RESTRICT]

See DROP OPERATOR for more information.

DROP OPERATOR CLASS

Removes an operator class.

DROP OPERATOR CLASS [IF EXISTS] <name> USING <index_method> [CASCADE | RESTRICT]

See DROP OPERATOR CLASS for more information.

DROP OPERATOR FAMILY

Removes an operator family.

DROP OPERATOR FAMILY [IF EXISTS] <name> USING <index_method> [CASCADE | RESTRICT]

See DROP OPERATOR FAMILY for more information.

DROP OWNED

Removes database objects owned by a database role.

DROP OWNED BY <name> [, ...] [CASCADE | RESTRICT]

See DROP OWNED for more information.

DROP PROTOCOL

Removes a external table data access protocol from a database.

DROP PROTOCOL [IF EXISTS] <name>

See DROP PROTOCOL for more information.

DROP RESOURCE GROUP

Removes a resource group.

DROP RESOURCE GROUP <group_name>

See DROP RESOURCE GROUP for more information.

DROP RESOURCE QUEUE

Removes a resource queue.

DROP RESOURCE QUEUE <queue_name>

See DROP RESOURCE QUEUE for more information.

DROP ROLE

Removes a database role.

DROP ROLE [IF EXISTS] <name> [, ...]

See DROP ROLE for more information.

DROP RULE

Removes a rewrite rule.

DROP RULE [IF EXISTS] <name> ON <table_name> [CASCADE | RESTRICT]

See DROP RULE for more information.

DROP SCHEMA

Removes a schema.

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

See DROP SCHEMA for more information.

DROP SEQUENCE

Removes a sequence.

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

See DROP SEQUENCE for more information.

DROP SERVER

Removes a foreign server descriptor.

DROP SERVER [ IF EXISTS ] <servername> [ CASCADE | RESTRICT ]

See DROP SERVER for more information.

DROP TABLE

Removes a table.

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

See DROP TABLE for more information.

DROP TABLESPACE

Removes a tablespace.

DROP TABLESPACE [IF EXISTS] <tablespacename>

See DROP TABLESPACE for more information.

DROP TEXT SEARCH CONFIGURATION

Removes a text search configuration.

DROP TEXT SEARCH CONFIGURATION [ IF EXISTS ] <name> [ CASCADE | RESTRICT ]

See DROP TEXT SEARCH CONFIGURATION for more information.

DROP TEXT SEARCH DICTIONARY

Removes a text search dictionary.

DROP TEXT SEARCH DICTIONARY [ IF EXISTS ] <name> [ CASCADE | RESTRICT ]

See DROP TEXT SEARCH DICTIONARY for more information.

DROP TEXT SEARCH PARSER

Remove a text search parser.

DROP TEXT SEARCH PARSER [ IF EXISTS ] <name> [ CASCADE | RESTRICT ]

See DROP TEXT SEARCH PARSER for more information.

DROP TEXT SEARCH TEMPLATE

Removes a text search template.

DROP TEXT SEARCH TEMPLATE [ IF EXISTS ] <name> [ CASCADE | RESTRICT ]

See DROP TEXT SEARCH TEMPLATE for more information.

DROP TYPE

Removes a data type.

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

See DROP TYPE for more information.

DROP USER

Removes a database role.

DROP USER [IF EXISTS] <name> [, ...]

See DROP USER for more information.

DROP USER MAPPING

Removes a user mapping for a foreign server.

DROP USER MAPPING [ IF EXISTS ] { <username> | USER | CURRENT_USER | PUBLIC } 
    SERVER <servername>

See DROP USER MAPPING for more information.

DROP VIEW

Removes a view.

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

See DROP VIEW for more information.

END

Commits the current transaction.

END [WORK | TRANSACTION]

See END for more information.

EXECUTE

Runs a prepared SQL statement.

EXECUTE <name> [ (<parameter> [, ...] ) ]

See EXECUTE for more information.

EXPLAIN

Shows the query plan of a statement.

EXPLAIN [ ( <option> [, ...] ) ] <statement>
EXPLAIN [ANALYZE] [VERBOSE] <statement>

See EXPLAIN for more information.

FETCH

Retrieves rows from a query using a cursor.

FETCH [ <forward_direction> { FROM | IN } ] <cursor_name>

See FETCH for more information.

GRANT

Defines access privileges.

GRANT { {SELECT | INSERT | UPDATE | DELETE | REFERENCES | 
TRIGGER | TRUNCATE } [, ...] | ALL [PRIVILEGES] }
    ON { [TABLE] <table_name> [, ...]
         | ALL TABLES IN SCHEMA <schema_name> [, ...] }
    TO { [ GROUP ] <role_name> | PUBLIC} [, ...] [ WITH GRANT OPTION ] 

GRANT { { SELECT | INSERT | UPDATE | REFERENCES } ( <column_name> [, ...] )
    [, ...] | ALL [ PRIVILEGES ] ( <column_name> [, ...] ) }
    ON [ TABLE ] <table_name> [, ...]
    TO { <role_name> | PUBLIC } [, ...] [ WITH GRANT OPTION ]

GRANT { {USAGE | SELECT | UPDATE} [, ...] | ALL [PRIVILEGES] }
    ON { SEQUENCE <sequence_name> [, ...]
         | ALL SEQUENCES IN SCHEMA <schema_name> [, ...] }
    TO { [ GROUP ] <role_name> | PUBLIC } [, ...] [ WITH GRANT OPTION ] 

GRANT { {CREATE | CONNECT | TEMPORARY | TEMP} [, ...] | ALL 
[PRIVILEGES] }
    ON DATABASE <database_name> [, ...]
    TO { [ GROUP ] <role_name> | PUBLIC } [, ...] [ WITH GRANT OPTION ]

GRANT { USAGE | ALL [ PRIVILEGES ] }
    ON DOMAIN <domain_name> [, ...]
    TO { [ GROUP ] <role_name> | PUBLIC } [, ...] [ WITH GRANT OPTION ]

GRANT { USAGE | ALL [ PRIVILEGES ] }
    ON FOREIGN DATA WRAPPER <fdw_name> [, ...]
    TO { [ GROUP ] <role_name> | PUBLIC } [, ...] [ WITH GRANT OPTION ]

GRANT { USAGE | ALL [ PRIVILEGES ] }
    ON FOREIGN SERVER <server_name> [, ...]
    TO { [ GROUP ] <role_name> | PUBLIC } [, ...] [ WITH GRANT OPTION ]

GRANT { EXECUTE | ALL [PRIVILEGES] }
    ON { FUNCTION <function_name> ( [ [ <argmode> ] [ <argname> ] <argtype> [, ...] 
] ) [, ...]
        | ALL FUNCTIONS IN SCHEMA <schema_name> [, ...] }
    TO { [ GROUP ] <role_name> | PUBLIC } [, ...] [ WITH GRANT OPTION ]

GRANT { USAGE | ALL [PRIVILEGES] }
    ON LANGUAGE <lang_name> [, ...]
    TO { [ GROUP ] <role_name> | PUBLIC } [, ...] [ WITH GRANT OPTION ]

GRANT { { CREATE | USAGE } [, ...] | ALL [PRIVILEGES] }
    ON SCHEMA <schema_name> [, ...]
    TO { [ GROUP ] <role_name> | PUBLIC}  [, ...] [ WITH GRANT OPTION ]

GRANT { CREATE | ALL [PRIVILEGES] }
    ON TABLESPACE <tablespace_name> [, ...]
    TO { [ GROUP ] <role_name> | PUBLIC } [, ...] [ WITH GRANT OPTION ]

GRANT { USAGE | ALL [ PRIVILEGES ] }
    ON TYPE <type_name> [, ...]
    TO { [ GROUP ] <role_name> | PUBLIC } [, ...] [ WITH GRANT OPTION ]

GRANT <parent_role> [, ...] 
    TO <member_role> [, ...] [WITH ADMIN OPTION]

GRANT { SELECT | INSERT | ALL [PRIVILEGES] } 
    ON PROTOCOL <protocolname>
    TO <username>

See GRANT for more information.

INSERT

Creates new rows in a table.

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

See INSERT for more information.

LOAD

Loads or reloads a shared library file.

LOAD '<filename>'

See LOAD for more information.

LOCK

Locks a table.

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

See LOCK for more information.

MOVE

Positions a cursor.

MOVE [ <forward_direction> [ FROM | IN ] ] <cursor_name>

See MOVE for more information.

PREPARE

Prepare a statement for execution.

PREPARE <name> [ (<datatype> [, ...] ) ] AS <statement>

See PREPARE for more information.

REASSIGN OWNED

Changes the ownership of database objects owned by a database role.

REASSIGN OWNED BY <old_role> [, ...] TO <new_role>

See REASSIGN OWNED for more information.

REFRESH MATERIALIZED VIEW

Replaces the contents of a materialized view.

REFRESH MATERIALIZED VIEW [ CONCURRENTLY ] <name>
    [ WITH [ NO ] DATA ]

See REFRESH MATERIALIZED VIEW for more information.

REINDEX

Rebuilds indexes.

REINDEX {INDEX | TABLE | DATABASE | SYSTEM} <name>

See REINDEX for more information.

RELEASE SAVEPOINT

Destroys a previously defined savepoint.

RELEASE [SAVEPOINT] <savepoint_name>

See RELEASE SAVEPOINT for more information.

RESET

Restores the value of a system configuration parameter to the default value.

RESET <configuration_parameter>

RESET ALL

See RESET for more information.

RETRIEVE

Retrieves rows from a query using a parallel retrieve cursor.

RETRIEVE { <count> | ALL } FROM ENDPOINT <endpoint_name>

See RETRIEVE for more information.

REVOKE

Removes access privileges.

REVOKE [GRANT OPTION FOR] { {SELECT | INSERT | UPDATE | DELETE 
       | REFERENCES | TRIGGER | TRUNCATE } [, ...] | ALL [PRIVILEGES] }

       ON { [TABLE] <table_name> [, ...]
            | ALL TABLES IN SCHEMA schema_name [, ...] }
       FROM { [ GROUP ] <role_name> | PUBLIC} [, ...]
       [CASCADE | RESTRICT]

REVOKE [ GRANT OPTION FOR ] { { SELECT | INSERT | UPDATE 
       | REFERENCES } ( <column_name> [, ...] )
       [, ...] | ALL [ PRIVILEGES ] ( <column_name> [, ...] ) }
       ON [ TABLE ] <table_name> [, ...]
       FROM { [ GROUP ]  <role_name> | PUBLIC } [, ...]
       [ CASCADE | RESTRICT ]

REVOKE [GRANT OPTION FOR] { {USAGE | SELECT | UPDATE} [,...] 
       | ALL [PRIVILEGES] }
       ON { SEQUENCE <sequence_name> [, ...]
            | ALL SEQUENCES IN SCHEMA schema_name [, ...] }
       FROM { [ GROUP ] <role_name> | PUBLIC } [, ...]
       [CASCADE | RESTRICT]

REVOKE [GRANT OPTION FOR] { {CREATE | CONNECT 
       | TEMPORARY | TEMP} [, ...] | ALL [PRIVILEGES] }
       ON DATABASE <database_name> [, ...]
       FROM { [ GROUP ] <role_name> | PUBLIC} [, ...]
       [CASCADE | RESTRICT]

REVOKE [ GRANT OPTION FOR ]
       { USAGE | ALL [ PRIVILEGES ] }
       ON DOMAIN <domain_name> [, ...]
       FROM { [ GROUP ] <role_name> | PUBLIC } [, ...]
       [ CASCADE | RESTRICT ]


REVOKE [ GRANT OPTION FOR ]
       { USAGE | ALL [ PRIVILEGES ] }
       ON FOREIGN DATA WRAPPER <fdw_name> [, ...]
       FROM { [ GROUP ] <role_name> | PUBLIC } [, ...]
       [ CASCADE | RESTRICT ]

REVOKE [ GRANT OPTION FOR ]
       { USAGE | ALL [ PRIVILEGES ] }
       ON FOREIGN SERVER <server_name> [, ...]
       FROM { [ GROUP ] <role_name> | PUBLIC } [, ...]
       [ CASCADE | RESTRICT ]

REVOKE [GRANT OPTION FOR] {EXECUTE | ALL [PRIVILEGES]}
       ON { FUNCTION <funcname> ( [[<argmode>] [<argname>] <argtype>
                              [, ...]] ) [, ...]
            | ALL FUNCTIONS IN SCHEMA schema_name [, ...] }
       FROM { [ GROUP ] <role_name> | PUBLIC} [, ...]
       [CASCADE | RESTRICT]

REVOKE [GRANT OPTION FOR] {USAGE | ALL [PRIVILEGES]}
       ON LANGUAGE <langname> [, ...]
       FROM { [ GROUP ]  <role_name> | PUBLIC} [, ...]
       [ CASCADE | RESTRICT ]

REVOKE [GRANT OPTION FOR] { {CREATE | USAGE} [, ...] 
       | ALL [PRIVILEGES] }
       ON SCHEMA <schema_name> [, ...]
       FROM { [ GROUP ] <role_name> | PUBLIC} [, ...]
       [CASCADE | RESTRICT]

REVOKE [GRANT OPTION FOR] { CREATE | ALL [PRIVILEGES] }
       ON TABLESPACE <tablespacename> [, ...]
       FROM { [ GROUP ] <role_name> | PUBLIC } [, ...]
       [CASCADE | RESTRICT]

REVOKE [ GRANT OPTION FOR ]
       { USAGE | ALL [ PRIVILEGES ] }
       ON TYPE <type_name> [, ...]
       FROM { [ GROUP ] <role_name> | PUBLIC } [, ...]
       [ CASCADE | RESTRICT ] 

REVOKE [ADMIN OPTION FOR] <parent_role> [, ...] 
       FROM [ GROUP ] <member_role> [, ...]
       [CASCADE | RESTRICT]

See REVOKE for more information.

ROLLBACK

Stops the current transaction.

ROLLBACK [WORK | TRANSACTION]

See ROLLBACK for more information.

ROLLBACK TO SAVEPOINT

Rolls back the current transaction to a savepoint.

ROLLBACK [WORK | TRANSACTION] TO [SAVEPOINT] <savepoint_name>

See ROLLBACK TO SAVEPOINT for more information.

SAVEPOINT

Defines a new savepoint within the current transaction.

SAVEPOINT <savepoint_name>

See SAVEPOINT for more information.

SELECT

Retrieves rows from a table or view.

[ WITH [ RECURSIVE ] <with_query> [, ...] ]
SELECT [ALL | DISTINCT [ON (<expression> [, ...])]]
  * | <expression >[[AS] <output_name>] [, ...]
  [FROM <from_item> [, ...]]
  [WHERE <condition>]
  [GROUP BY <grouping_element> [, ...]]
  [HAVING <condition> [, ...]]
  [WINDOW <window_name> AS (<window_definition>) [, ...] ]
  [{UNION | INTERSECT | EXCEPT} [ALL | DISTINCT] <select>]
  [ORDER BY <expression> [ASC | DESC | USING <operator>] [NULLS {FIRST | LAST}] [, ...]]
  [LIMIT {<count> | ALL}]
  [OFFSET <start> [ ROW | ROWS ] ]
  [FETCH { FIRST | NEXT } [ <count> ] { ROW | ROWS } ONLY]
  [FOR {UPDATE | NO KEY UPDATE | SHARE | KEY SHARE} [OF <table_name> [, ...]] [NOWAIT] [...]]

TABLE { [ ONLY ] <table_name> [ * ] | <with_query_name> }

See SELECT for more information.

SELECT INTO

Defines a new table from the results of a query.

[ WITH [ RECURSIVE ] <with_query> [, ...] ]
SELECT [ALL | DISTINCT [ON ( <expression> [, ...] )]]
    * | <expression> [AS <output_name>] [, ...]
    INTO [TEMPORARY | TEMP | UNLOGGED ] [TABLE] <new_table>
    [FROM <from_item> [, ...]]
    [WHERE <condition>]
    [GROUP BY <expression> [, ...]]
    [HAVING <condition> [, ...]]
    [{UNION | INTERSECT | EXCEPT} [ALL | DISTINCT ] <select>]
    [ORDER BY <expression> [ASC | DESC | USING <operator>] [NULLS {FIRST | LAST}] [, ...]]
    [LIMIT {<count> | ALL}]
    [OFFSET <start> [ ROW | ROWS ] ]
    [FETCH { FIRST | NEXT } [ <count> ] { ROW | ROWS } ONLY ]
    [FOR {UPDATE | SHARE} [OF <table_name> [, ...]] [NOWAIT] 
    [...]]

See SELECT INTO for more information.

SET

Changes the value of a Greenplum Database configuration parameter.

SET [SESSION | LOCAL] <configuration_parameter> {TO | =} <value> | 
    '<value>' | DEFAULT}

SET [SESSION | LOCAL] TIME ZONE {<timezone> | LOCAL | DEFAULT}

See SET for more information.

SET CONSTRAINTS

Sets constraint check timing for the current transaction.

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

See SET CONSTRAINTS for more information.

SET ROLE

Sets the current role identifier of the current session.

SET [SESSION | LOCAL] ROLE <rolename>

SET [SESSION | LOCAL] ROLE NONE

RESET ROLE

See SET ROLE for more information.

SET SESSION AUTHORIZATION

Sets the session role identifier and the current role identifier of the current session.

SET [SESSION | LOCAL] SESSION AUTHORIZATION <rolename>

SET [SESSION | LOCAL] SESSION AUTHORIZATION DEFAULT

RESET SESSION AUTHORIZATION

See SET SESSION AUTHORIZATION for more information.

SET TRANSACTION

Sets the characteristics of the current transaction.

SET TRANSACTION [<transaction_mode>] [READ ONLY | READ WRITE]

SET TRANSACTION SNAPSHOT <snapshot_id>

SET SESSION CHARACTERISTICS AS TRANSACTION <transaction_mode> 
     [READ ONLY | READ WRITE]
     [NOT] DEFERRABLE

See SET TRANSACTION for more information.

SHOW

Shows the value of a system configuration parameter.

SHOW <configuration_parameter>

SHOW ALL

See SHOW for more information.

START TRANSACTION

Starts a transaction block.

START TRANSACTION [<transaction_mode>] [READ WRITE | READ ONLY]

See START TRANSACTION for more information.

TRUNCATE

Empties a table of all rows.

TRUNCATE [TABLE] [ONLY] <name> [ * ] [, ...] 
    [ RESTART IDENTITY | CONTINUE IDENTITY ] [CASCADE | RESTRICT]

See TRUNCATE for more information.

UPDATE

Updates rows of a table.

[ WITH [ RECURSIVE ] <with_query> [, ...] ]
UPDATE [ONLY] <table> [[AS] <alias>]
   SET {<column> = {<expression> | DEFAULT} |
   (<column> [, ...]) = ({<expression> | DEFAULT} [, ...])} [, ...]
   [FROM <fromlist>]
   [WHERE <condition >| WHERE CURRENT OF <cursor_name> ]

See UPDATE for more information.

VACUUM

Garbage-collects and optionally analyzes a database.

VACUUM [({ FULL | FREEZE | VERBOSE | ANALYZE } [, ...])] [<table> [(<column> [, ...] )]]

VACUUM [FULL] [FREEZE] [VERBOSE] [<table>]

VACUUM [FULL] [FREEZE] [VERBOSE] ANALYZE
              [<table> [(<column> [, ...] )]]

See VACUUM for more information.

VALUES

Computes a set of rows.

VALUES ( <expression> [, ...] ) [, ...]
   [ORDER BY <sort_expression> [ ASC | DESC | USING <operator> ] [, ...] ]
   [LIMIT { <count> | ALL } ] 
   [OFFSET <start> [ ROW | ROWS ] ]
   [FETCH { FIRST | NEXT } [<count> ] { ROW | ROWS } ONLY ]

See VALUES for more information.

Parent topic: SQL Commands