SQL Commands

This part contains reference information for the SQL commands supported by ProtonBase. By “SQL” the language in general is meant; information about the standards conformance and compatibility of each command can be found on the respective reference page.

Table of Contents

ABORT — abort the current transaction

ALTER DATABASE — change a database

ALTER DEFAULT PRIVILEGES — define default access privileges

ALTER EXTENSION — change the definition of an extension

ALTER FOREIGN DATA WRAPPER - change the definition of a foreign-data wrapper

ALTER FOREIGN TABLE - change the definition of a foreign table

ALTER INDEX — change the definition of an index

ALTER MATERIALIZED VIEW — change the definition of a materialized view

ALTER POLICY - change the definition of a row-level security policy

ALTER SCHEMA — change the definition of a schema

ALTER SEQUENCE — change the definition of a sequence generator

ALTER SERVER — change the definition of a foreign server

ALTER TABLE — change the definition of a table

ALTER TABLESPACE — change the definition of a tablespace

ALTER USER MAPPING — change the definition of a user mapping

ALTER VIEW — change the definition of a view

ANALYZE — collect statistics about a database

BEGIN — start a transaction block

CHECKPOINT — force a write-ahead log checkpoint

CLOSE — close a cursor

COMMENT — define or change the comment of an object

COMMIT — commit the current transaction

COPY — copy data between a file and a table

CREATE CAST — create a new cast

CREATE DATABASE — create a new database

CREATE EXTENSION — install an extension

CREATE FOREIGN DATA WRAPPER — define a new foreign-data wrapper

CREATE FOREIGN TABLE — define a new foreign table

CREATE INDEX — define a new index

CREATE MATERIALIZED VIEW — define a new materialized view

CREATE POLICY - define a new row-level security policy for a table

CREATE SCHEMA — define a new schema

CREATE SEQUENCE — define a new sequence generator

CREATE SERVER — define a new foreign server

CREATE TABLE — define a new table

CREATE TABLESPACE — define a new tablespace

CREATE TABLE AS — define a new table from the results of a query

CREATE USER MAPPING — define a new mapping of a user to a foreign server

CREATE VIEW — define a new view

DEALLOCATE — deallocate a prepared statement

DECLARE — define a cursor

DELETE — delete rows of a table

DISCARD — discard session state

DROP CAST — remove a cast

DROP DATABASE — remove a database

DROP EXTENSION — remove an extension

DROP FOREIGN DATA WRAPPER — remove a foreign-data wrapper

DROP FOREIGN TABLE — remove a foreign table

DROP INDEX — remove an index

DROP MATERIALIZED VIEW — remove a materialized view

DROP POLICY - remove a row-level security policy from a table

DROP SCHEMA — remove a schema

DROP SEQUENCE — remove a sequence

DROP SERVER — remove a foreign server descriptor

DROP TABLE — remove a table

DROP TABLESPACE — remove a tablespace

DROP USER MAPPING — remove a user mapping for a foreign server

DROP VIEW — remove a view

END — commit the current transaction

EXECUTE — execute a prepared statement

EXPLAIN — show the execution plan of a statement

FETCH — retrieve rows from a query using a cursor

GRANT — define access privileges

IMPORT FOREIGN SCHEMA — import table definitions from a foreign server

INSERT — create new rows in a table

MERGE — conditionally insert, update, or delete rows of a table

MOVE — position a cursor

PREPARE — prepare a statement for execution

REASSIGN OWNED — change the ownership of database objects owned by a database role

REFRESH MATERIALIZED VIEW — replace the contents of a materialized view

REINDEX — rebuild indexes

RELEASE SAVEPOINT — destroy a previously defined savepoint

RESET — restore the value of a run-time parameter to the default value

REVOKE — remove access privileges

ROLLBACK — abort the current transaction

ROLLBACK TO SAVEPOINT — roll back to a savepoint

SAVEPOINT — define a new savepoint within the current transaction

SELECT — retrieve rows from a table or view

SELECT INTO — define a new table from the results of a query

SET — change a run-time parameter

SET ROLE — set the current user identifier of the current session

SET TRANSACTION — set the characteristics of the current transaction

SHOW — show the value of a run-time parameter

START TRANSACTION — start a transaction block

TRUNCATE — empty a table or set of tables

UPDATE — update rows of a table

VALUES — compute a set of rows