Search PostgreSQL documentation
PG 18 · Browse by category, or enter a name or keyword
Category index248
CREATE LANGUAGECREATE LANGUAGE
Functions & Procedures
10
define a new procedural language
CREATE [ OR REPLACE ] [ PROCEDURAL ] LANGUAGE name
CREATE [ OR REPLACE ] [ TRUSTED ] [ PROCEDURAL ] LANGUAGE name
H…SQL Commands · Functions & Procedures
CREATE MATERIALIZED VIEWCREATE MATERIALIZED VIEW
Tables & Views
10
define a new materialized view
CREATE MATERIALIZED VIEW [ IF NOT EXISTS ] table_name
[ (column_name [, ...] ) ]
[ WITH ( storage_parameter [= value…SQL Commands · Tables & Views
CREATE OPERATORCREATE OPERATOR
Types & Operators
10
define a new operator
CREATE OPERATOR name (
PROCEDURE = function_name
[, LEFTARG = left_type ] [, RIGHTARG = right_type ]
[, COMMUTATOR = com_op ] [, NE…SQL Commands · Types & Operators
CREATE OPERATOR CLASSCREATE OPERATOR CLASS
Types & Operators
10
define a new operator class
CREATE OPERATOR CLASS name [ DEFAULT ] FOR TYPE data_type
USING index_method [ FAMILY family_name ] AS
{ OPERATOR strat…SQL Commands · Types & Operators
CREATE OPERATOR FAMILYCREATE OPERATOR FAMILY
Types & Operators
10
define a new operator family
CREATE OPERATOR FAMILY name USING index_method
CREATE OPERATOR FAMILY creates a new operator family. An operator fami…SQL Commands · Types & Operators
CREATE POLICYCREATE POLICY
Roles & Privileges
10
define a new row level security policy for a table
CREATE POLICY name ON table_name
[ AS { PERMISSIVE | RESTRICTIVE } ]
[ FOR { ALL | SELECT | INSERT | UP…SQL Commands · Roles & Privileges
CREATE PROCEDURECREATE PROCEDURE
Functions & Procedures
11
define a new procedure
CREATE [ OR REPLACE ] PROCEDURE
name ( [ [ argmode ] [ argname ] argtype [ { DEFAULT | = } default_expr ] [, ...] ] )
{ LANG…SQL Commands · Functions & Procedures
CREATE PROPERTY GRAPHCREATE PROPERTY GRAPH
Other Objects
19
define a new SQL-property graph
CREATE [ TEMP | TEMPORARY ] PROPERTY GRAPH name
[ {VERTEX|NODE} TABLES ( vertex_table_definition [, ...] ) ]
[ {EDGE|RE…SQL Commands · Other Objects
CREATE PUBLICATIONCREATE PUBLICATION
Logical Replication
10
define a new publication
CREATE PUBLICATION name
[ FOR TABLE [ ONLY ] table_name [ * ] [, ...]
| FOR ALL TABLES ]
[ WITH ( publication_parameter [= …SQL Commands · Logical Replication
CREATE ROLECREATE ROLE
Roles & Privileges
10
define a new database role
CREATE ROLE name [ [ WITH ] option [ ... ] ]
where option can be:
SUPERUSER | NOSUPERUSER
| CREATEDB | NOCREATEDB
| CREATEROLE …SQL Commands · Roles & Privileges
CREATE RULECREATE RULE
Triggers & Rules
10
define a new rewrite rule
CREATE [ OR REPLACE ] RULE name AS ON event
TO table_name [ WHERE condition ]
DO [ ALSO | INSTEAD ] { NOTHING | command | ( command …SQL Commands · Triggers & Rules
CREATE SCHEMACREATE SCHEMA
Databases & Schemas
10
define a new schema
CREATE SCHEMA schema_name [ AUTHORIZATION role_specification ] [ schema_element [ ... ] ]
CREATE SCHEMA AUTHORIZATION role_specificat…SQL Commands · Databases & Schemas
CREATE SEQUENCECREATE SEQUENCE
Tables & Views
10
define a new sequence generator
CREATE [ TEMPORARY | TEMP ] SEQUENCE [ IF NOT EXISTS ] name
[ AS data_type ]
[ INCREMENT [ BY ] increment ]
[ MINVALUE minva…SQL Commands · Tables & Views
CREATE SERVERCREATE SERVER
Foreign Data
10
define a new foreign server
CREATE SERVER [IF NOT EXISTS] server_name [ TYPE 'server_type' ] [ VERSION 'server_version' ]
FOREIGN DATA WRAPPER fdw_name
[ OPTION…SQL Commands · Foreign Data
CREATE STATISTICSCREATE STATISTICS
Indexes & Statistics
10
define extended statistics
CREATE STATISTICS [ IF NOT EXISTS ] statistics_name
[ ( statistics_kind [, ... ] ) ]
ON column_name, column_name [, ...]
…SQL Commands · Indexes & Statistics
CREATE SUBSCRIPTIONCREATE SUBSCRIPTION
Logical Replication
10
define a new subscription
CREATE SUBSCRIPTION subscription_name
CONNECTION 'conninfo'
PUBLICATION publication_name [, ...]
[ WITH ( subscription_pa…SQL Commands · Logical Replication
CREATE TABLE ASCREATE TABLE AS
Tables & Views
10
define a new table from the results of a query
CREATE [ [ GLOBAL | LOCAL ] { TEMPORARY | TEMP } | UNLOGGED ] TABLE [ IF NOT EXISTS ] table_name
[ (column_na…SQL Commands · Tables & Views
CREATE TABLESPACECREATE TABLESPACE
Databases & Schemas
10
define a new tablespace
CREATE TABLESPACE tablespace_name
[ OWNER { new_owner | CURRENT_USER | SESSION_USER } ]
LOCATION 'directory'
[ WITH ( tablesp…SQL Commands · Databases & Schemas
CREATE TEXT SEARCH CONFIGURATIONCREATE TEXT SEARCH CONFIGURATION
Text Search
10
define a new text search configuration
CREATE TEXT SEARCH CONFIGURATION name (
PARSER = parser_name |
COPY = source_config
)
CREATE TEXT SEARC…SQL Commands · Text Search
CREATE TEXT SEARCH DICTIONARYCREATE TEXT SEARCH DICTIONARY
Text Search
10
define a new text search dictionary
CREATE TEXT SEARCH DICTIONARY name (
TEMPLATE = template
[, option = value [, ... ]]
)
CREATE TEXT SEARCH DIC…SQL Commands · Text Search
CREATE TEXT SEARCH PARSERCREATE TEXT SEARCH PARSER
Text Search
10
define a new text search parser
CREATE TEXT SEARCH PARSER name (
START = start_function ,
GETTOKEN = gettoken_function ,
END = end_function ,
LEXTYPE…SQL Commands · Text Search
CREATE TEXT SEARCH TEMPLATECREATE TEXT SEARCH TEMPLATE
Text Search
10
define a new text search template
CREATE TEXT SEARCH TEMPLATE name (
[ INIT = init_function , ]
LEXIZE = lexize_function
)
CREATE TEXT SEARCH TEMPL…SQL Commands · Text Search
CREATE TRANSFORMCREATE TRANSFORM
Functions & Procedures
10
define a new transform
CREATE [ OR REPLACE ] TRANSFORM FOR type_name LANGUAGE lang_name (
FROM SQL WITH FUNCTION from_sql_function_name [ (argument…SQL Commands · Functions & Procedures
CREATE TRIGGERCREATE TRIGGER
Triggers & Rules
10
define a new trigger
CREATE [ CONSTRAINT ] TRIGGER name { BEFORE | AFTER | INSTEAD OF } { event [ OR ... ] }
ON table_name
[ FROM referenced_table_name ]
[…SQL Commands · Triggers & Rules
CREATE TYPECREATE TYPE
Types & Operators
10
define a new data type
CREATE TYPE name AS
( [ attribute_name data_type [ COLLATE collation ] [, ... ] ] )
CREATE TYPE name AS ENUM
( [ 'label' [, ... ] ] )…SQL Commands · Types & Operators
CREATE USERCREATE USER
Roles & Privileges
10
define a new database role
CREATE USER name [ [ WITH ] option [ ... ] ]
where option can be:
SUPERUSER | NOSUPERUSER
| CREATEDB | NOCREATEDB
| CREATEROLE …SQL Commands · Roles & Privileges
CREATE USER MAPPINGCREATE USER MAPPING
Foreign Data
10
define a new mapping of a user to a foreign server
CREATE USER MAPPING [IF NOT EXISTS] FOR { user_name | USER | CURRENT_USER | PUBLIC }
SERVER server_name…SQL Commands · Foreign Data
CREATE VIEWCREATE VIEW
Tables & Views
10
define a new view
CREATE [ OR REPLACE ] [ TEMP | TEMPORARY ] [ RECURSIVE ] VIEW name [ ( column_name [, ...] ) ]
[ WITH ( view_option_name [= view_option_value]…SQL Commands · Tables & Views
CUBE7.2.4. GROUPING SETS, CUBE, and ROLLUP # More complex grouping operations than those described above are possible using the concept of grouping sets. The data selected by the FROM and WHERE …Table Expressions › GROUPING SETS, CUBE, and ROLLUP
current_datecurrent_date → date Current date; see Section 9.9.5 current_date → 2019-12-23Date/Time Functions and Operators
current_rolecurrent_role → name This is equivalent to current_user.System Information Functions and Operators › Session Information Functions
current_timecurrent_time → time with time zone Current time of day; see Section 9.9.5 current_time → 14:39:53.662522-05Date/Time Functions and Operators
current_timestampcurrent_timestamp → timestamp with time zone Current date and time (start of current transaction); see Section 9.9.5 current_timestamp → 2019-12-23 14:39:53.662522-05Date/Time Functions and Operators
current_usercurrent_user → name Returns the user name of the current execution context.System Information Functions and Operators › Session Information Functions
DEALLOCATEDEALLOCATE
Cursors & Prepared Statements
10
deallocate a prepared statement
DEALLOCATE [ PREPARE ] { name | ALL }
DEALLOCATE is used to deallocate a previously prepared SQL statement. If you…SQL Commands · Cursors & Prepared Statements
DECLAREDECLARE
Cursors & Prepared Statements
10
define a cursor
DECLARE name [ BINARY ] [ INSENSITIVE ] [ [ NO ] SCROLL ]
CURSOR [ { WITH | WITHOUT } HOLD ] FOR query
DECLARE allows a user to creat…SQL Commands · Cursors & Prepared Statements
DELETEDELETE
Queries & Data
10
delete rows of a table
[ WITH [ RECURSIVE ] with_query [, ...] ]
DELETE FROM [ ONLY ] table_name [ * ] [ [ AS ] alias ]
[ USING from_item [, ...] ]
[ WHERE condition…SQL Commands · Queries & Data
DISCARDDISCARD
Sessions & Settings
10
discard session state
DISCARD { ALL | PLANS | SEQUENCES | TEMPORARY | TEMP }
DISCARD releases internal resources associated with a database session. This comma…SQL Commands · Sessions & Settings
DISTINCT7.3.3. DISTINCT # After the select list has been processed, the result table can optionally be subject to the elimination of duplicate rows. The DISTINCT key word is written directly after S…Select Lists › DISTINCT
DODO
Functions & Procedures
10
execute an anonymous code block
DO [ LANGUAGE lang_name ] code
DO executes an anonymous code block, or in other words a transient anonymous function in a procedu…SQL Commands · Functions & Procedures
More results
Find definitions in the PostgreSQL manuals, reference library, and extension catalogue.
pg17: choose a version ex: extensions only ↑↓ select ↵ open