Search PostgreSQL documentation
PG 18 · Browse by category, or enter a name or keyword
Category index248
CREATE TABLECREATE TABLE
Tables & Views
10
define a new table
CREATE [ [ GLOBAL | LOCAL ] { TEMPORARY | TEMP } | UNLOGGED ] TABLE [ IF NOT EXISTS ] table_name ( [
{ column_name data_type [ COLLATE colla…SQL Commands · Tables & Views
EXPLAINEXPLAIN
Queries & Data
10
show the execution plan of a statement
EXPLAIN [ ( option [, ...] ) ] statement
EXPLAIN [ ANALYZE ] [ VERBOSE ] statement
where option can be one of:
ANALYZE [ boo…SQL Commands · Queries & Data
SELECTEmpty SELECT Lists The list of output expressions after SELECT can be empty, producing a zero-column result table. This is not valid syntax according to the SQL standard. PostgreSQL allows i…SELECT › Compatibility › Empty SELECT Lists
SELECTSELECT
Queries & Data
10
retrieve rows from a table or view
[ WITH [ RECURSIVE ] with_query [, ...] ]
SELECT [ ALL | DISTINCT [ ON ( expression [, ...] ) ] ]
[ * | expression [ [ AS ] output…SQL Commands · Queries & Data
ABORTABORT
Transactions
10
abort the current transaction
ABORT [ WORK | TRANSACTION ]
ABORT rolls back the current transaction and causes all the updates made by the transaction to be discarded. …SQL Commands · Transactions
ALL9.25.4. ALL (array) # expression operator ALL (array expression) The right-hand side is a parenthesized expression, which must yield an array value. The left-hand expression is evaluated and…Row and Array Comparisons › ALL (array)
ALTER AGGREGATEALTER AGGREGATE
Functions & Procedures
10
change the definition of an aggregate function
ALTER AGGREGATE name ( aggregate_signature ) RENAME TO new_name
ALTER AGGREGATE name ( aggregate_sign…SQL Commands · Functions & Procedures
ALTER COLLATIONALTER COLLATION
Types & Operators
10
change the definition of a collation
ALTER COLLATION name REFRESH VERSION
ALTER COLLATION name RENAME TO new_name
ALTER COLLATION name OWNER TO { new_ow…SQL Commands · Types & Operators
ALTER CONVERSIONALTER CONVERSION
Types & Operators
10
change the definition of a conversion
ALTER CONVERSION name RENAME TO new_name
ALTER CONVERSION name OWNER TO { new_owner | CURRENT_USER | SESSION_USER …SQL Commands · Types & Operators
ALTER DATABASEALTER DATABASE
Databases & Schemas
10
change a database
ALTER DATABASE name [ [ WITH ] option [ ... ] ]
where option can be:
ALLOW_CONNECTIONS allowconn
CONNECTION LIMIT connlimit
IS_TEMPL…SQL Commands · Databases & Schemas
ALTER DEFAULT PRIVILEGESALTER DEFAULT PRIVILEGES
Roles & Privileges
10
define default access privileges
ALTER DEFAULT PRIVILEGES
[ FOR { ROLE | USER } target_role [, ...] ]
[ IN SCHEMA schema_name [, ...] ]
abbrevi…SQL Commands · Roles & Privileges
ALTER DOMAINALTER DOMAIN
Types & Operators
10
change the definition of a domain
ALTER DOMAIN name
{ SET DEFAULT expression | DROP DEFAULT }
ALTER DOMAIN name
{ SET | DROP } NOT NULL
ALTER DOMAIN name
AD…SQL Commands · Types & Operators
ALTER EVENT TRIGGERALTER EVENT TRIGGER
Triggers & Rules
10
change the definition of an event trigger
ALTER EVENT TRIGGER name DISABLE
ALTER EVENT TRIGGER name ENABLE [ REPLICA | ALWAYS ]
ALTER EVENT TRIGGER na…SQL Commands · Triggers & Rules
ALTER EXTENSIONALTER EXTENSION
Extensions & Access Methods
10
change the definition of an extension
ALTER EXTENSION name UPDATE [ TO new_version ]
ALTER EXTENSION name SET SCHEMA new_schema
ALTER EXTENSION…SQL Commands · Extensions & Access Methods
ALTER FOREIGN DATA WRAPPERALTER FOREIGN DATA WRAPPER
Foreign Data
10
change the definition of a foreign-data wrapper
ALTER FOREIGN DATA WRAPPER name
[ HANDLER handler_function | NO HANDLER ]
[ VALIDATOR validator_fun…SQL Commands · Foreign Data
ALTER FOREIGN TABLEALTER FOREIGN TABLE
Foreign Data
10
change the definition of a foreign table
ALTER FOREIGN TABLE [ IF EXISTS ] [ ONLY ] name [ * ]
action [, ... ]
ALTER FOREIGN TABLE [ IF EXISTS ] [ ONLY ] …SQL Commands · Foreign Data
ALTER FUNCTIONALTER FUNCTION
Functions & Procedures
10
change the definition of a function
ALTER FUNCTION name [ ( [ [ argmode ] [ argname ] argtype [, ...] ] ) ]
action [ ... ] [ RESTRICT ]
ALTER FUNCTIO…SQL Commands · Functions & Procedures
ALTER GROUPALTER GROUP
Roles & Privileges
10
change role name or membership
ALTER GROUP role_specification ADD USER user_name [, ... ]
ALTER GROUP role_specification DROP USER user_name [, ... ]
where…SQL Commands · Roles & Privileges
ALTER INDEXALTER INDEX
Indexes & Statistics
10
change the definition of an index
ALTER INDEX [ IF EXISTS ] name RENAME TO new_name
ALTER INDEX [ IF EXISTS ] name SET TABLESPACE tablespace_name
ALTER IN…SQL Commands · Indexes & Statistics
ALTER LANGUAGEALTER LANGUAGE
Functions & Procedures
10
change the definition of a procedural language
ALTER [ PROCEDURAL ] LANGUAGE name RENAME TO new_name
ALTER [ PROCEDURAL ] LANGUAGE name OWNER TO { ne…SQL Commands · Functions & Procedures
ALTER LARGE OBJECTALTER LARGE OBJECT
Other Objects
10
change the definition of a large object
ALTER LARGE OBJECT large_object_oid OWNER TO { new_owner | CURRENT_USER | SESSION_USER }
ALTER LARGE OBJECT change…SQL Commands · Other Objects
ALTER MATERIALIZED VIEWALTER MATERIALIZED VIEW
Tables & Views
10
change the definition of a materialized view
ALTER MATERIALIZED VIEW [ IF EXISTS ] name
action [, ... ]
ALTER MATERIALIZED VIEW name
DEPENDS ON EXTE…SQL Commands · Tables & Views
ALTER OPERATORALTER OPERATOR
Types & Operators
10
change the definition of an operator
ALTER OPERATOR name ( { left_type | NONE } , { right_type | NONE } )
OWNER TO { new_owner | CURRENT_USER | SESSION_US…SQL Commands · Types & Operators
ALTER OPERATOR CLASSALTER OPERATOR CLASS
Types & Operators
10
change the definition of an operator class
ALTER OPERATOR CLASS name USING index_method
RENAME TO new_name
ALTER OPERATOR CLASS name USING index_me…SQL Commands · Types & Operators
ALTER OPERATOR FAMILYALTER OPERATOR FAMILY
Types & Operators
10
change the definition of an operator family
ALTER OPERATOR FAMILY name USING index_method ADD
{ OPERATOR strategy_number operator_name ( op_type, o…SQL Commands · Types & Operators
ALTER POLICYALTER POLICY
Roles & Privileges
10
change the definition of a row level security policy
ALTER POLICY name ON table_name RENAME TO new_name
ALTER POLICY name ON table_name
[ TO { role_name |…SQL Commands · Roles & Privileges
ALTER PROCEDUREALTER PROCEDURE
Functions & Procedures
11
change the definition of a procedure
ALTER PROCEDURE name [ ( [ [ argmode ] [ argname ] argtype [, ...] ] ) ]
action [ ... ] [ RESTRICT ]
ALTER PROC…SQL Commands · Functions & Procedures
ALTER PROPERTY GRAPHALTER PROPERTY GRAPH
Other Objects
19
change the definition of an SQL-property graph
ALTER PROPERTY GRAPH name ADD
[ {VERTEX|NODE} TABLES ( vertex_table_definition [, ...] ) ]
[ {EDGE|RELATI…SQL Commands · Other Objects
ALTER PUBLICATIONALTER PUBLICATION
Logical Replication
10
change the definition of a publication
ALTER PUBLICATION name ADD TABLE [ ONLY ] table_name [ * ] [, ...]
ALTER PUBLICATION name SET TABLE [ ONLY ] t…SQL Commands · Logical Replication
ALTER ROLEALTER ROLE
Roles & Privileges
10
change a database role
ALTER ROLE role_specification [ WITH ] option [ ... ]
where option can be:
SUPERUSER | NOSUPERUSER
| CREATEDB | NOCREATEDB
| CREATER…SQL Commands · Roles & Privileges
ALTER ROUTINEALTER ROUTINE
Functions & Procedures
11
change the definition of a routine
ALTER ROUTINE name [ ( [ [ argmode ] [ argname ] argtype [, ...] ] ) ]
action [ ... ] [ RESTRICT ]
ALTER ROUTINE na…SQL Commands · Functions & Procedures
ALTER RULEALTER RULE
Triggers & Rules
10
change the definition of a rule
ALTER RULE name ON table_name RENAME TO new_name
ALTER RULE changes properties of an existing rule. Currently, the only availab…SQL Commands · Triggers & Rules
ALTER SCHEMAALTER SCHEMA
Databases & Schemas
10
change the definition of a schema
ALTER SCHEMA name RENAME TO new_name
ALTER SCHEMA name OWNER TO { new_owner | CURRENT_USER | SESSION_USER }
ALTER SCHEMA…SQL Commands · Databases & Schemas
ALTER SEQUENCEALTER SEQUENCE
Tables & Views
10
change the definition of a sequence generator
ALTER SEQUENCE [ IF EXISTS ] name
[ AS data_type ]
[ INCREMENT [ BY ] increment ]
[ MINVALUE minvalue | NO MINV…SQL Commands · Tables & Views
ALTER SERVERALTER SERVER
Foreign Data
10
change the definition of a foreign server
ALTER SERVER name [ VERSION 'new_version' ]
[ OPTIONS ( [ ADD | SET | DROP ] option ['value'] [, ... ] ) ]
ALTER SERVER…SQL Commands · Foreign Data
ALTER STATISTICSALTER STATISTICS
Indexes & Statistics
10
change the definition of an extended statistics object
ALTER STATISTICS name OWNER TO { new_owner | CURRENT_USER | SESSION_USER }
ALTER STATISTICS na…SQL Commands · Indexes & Statistics
ALTER SUBSCRIPTIONALTER SUBSCRIPTION
Logical Replication
10
change the definition of a subscription
ALTER SUBSCRIPTION name CONNECTION 'conninfo'
ALTER SUBSCRIPTION name SET PUBLICATION publication_name [, ..…SQL Commands · Logical Replication
ALTER SYSTEMALTER SYSTEM
Sessions & Settings
10
change a server configuration parameter
ALTER SYSTEM SET configuration_parameter { TO | = } { value | 'value' | DEFAULT }
ALTER SYSTEM RESET configuratio…SQL Commands · Sessions & Settings
ALTER TABLEALTER TABLE
Tables & Views
10
change the definition of a table
ALTER TABLE [ IF EXISTS ] [ ONLY ] name [ * ]
action [, ... ]
ALTER TABLE [ IF EXISTS ] [ ONLY ] name [ * ]
RENAME [ COLUMN ] c…SQL Commands · Tables & Views
ALTER TABLESPACEALTER TABLESPACE
Databases & Schemas
10
change the definition of a tablespace
ALTER TABLESPACE name RENAME TO new_name
ALTER TABLESPACE name OWNER TO { new_owner | CURRENT_USER | SESSION_USE…SQL Commands · Databases & Schemas
More results
Find definitions in the PostgreSQL manuals, reference library, and extension catalogue.
pg17: choose a version ex: extensions only ↑↓ select ↵ open