Basic SQL#

Data Description (DDL)#

SQL CommandsSupportedNotes and limitations
ALTER TABLESET SCHEMA and identity RESTART are not supported
CREATE DATABASE
CREATE TABLEUNLOGGED, storage parameters, and TABLESPACE are not supported
DROP DATABASEWITH (FORCE) is not supported
DROP TABLERESTRICT and CASCADE are not supported

Data Manipulation (DML)#

SQL CommandsSupportedNotes and limitations
CALL
DELETESupports RETURNING
INSERTSupports ON CONFLICT DO NOTHING / DO UPDATE and RETURNING
SELECTLocking clauses (FOR UPDATE / FOR SHARE) are not supported
UPDATESupports RETURNING
VALUES

All SQL#

Access management statements#

SQL CommandsSupportedNotes and limitations
ALTER DEFAULT PRIVILEGES
ALTER GROUP🟠Treated as ALTER ROLE; the ADD/DROP USER forms used to manage group membership are not supported
ALTER ROLE
ALTER USER
ALTER USER MAPPING
CREATE GROUPAlias for CREATE ROLE
CREATE ROLE
CREATE USER
CREATE USER MAPPING
DROP GROUP
DROP ROLE
DROP USER
DROP USER MAPPING
GRANTSupported for tables, schemas, databases, sequences, routines, and role grants; cross-database grants are not supported
REASSIGN OWNED
REVOKESame forms as GRANT

Data definition statements#

SQL CommandsSupportedNotes and limitations
ALTER AGGREGATE
ALTER COLLATION
ALTER CONVERSION
ALTER DATABASE
ALTER DOMAIN
ALTER EVENT TRIGGER
ALTER EXTENSION
ALTER FOREIGN DATA WRAPPER
ALTER FOREIGN TABLE
ALTER FUNCTION
ALTER INDEX
ALTER LANGUAGE
ALTER LARGE OBJECT
ALTER MATERIALIZED VIEW
ALTER OPERATOR
ALTER OPERATOR CLASS
ALTER OPERATOR FAMILY
ALTER POLICY
ALTER PROCEDURE
ALTER PUBLICATION
ALTER ROUTINE
ALTER RULE
ALTER SCHEMA
ALTER SEQUENCE🟠Only the OWNED BY form is supported; other forms (RESTART, INCREMENT, etc.) are not
ALTER SERVER
ALTER STATISTICS
ALTER SUBSCRIPTION
ALTER SYSTEM
ALTER TABLESET SCHEMA and identity RESTART are not supported
ALTER TABLESPACE
ALTER TEXT SEARCH CONFIGURATION
ALTER TEXT SEARCH DICTIONARY
ALTER TEXT SEARCH PARSER
ALTER TEXT SEARCH TEMPLATE
ALTER TRIGGER
ALTER TYPE
ALTER VIEW
COMMENT🟠Accepted but silently ignored; comments are not stored
CREATE ACCESS METHOD
CREATE AGGREGATE
CREATE CAST
CREATE COLLATION
CREATE CONVERSION
CREATE DATABASE
CREATE DOMAINCOLLATE is not supported
CREATE EVENT TRIGGER
CREATE EXTENSIONNon-public SCHEMA, VERSION, and CASCADE are not supported
CREATE FOREIGN DATA WRAPPER
CREATE FOREIGN TABLE
CREATE FUNCTIONSupports PL/pgSQL, SQL, and C functions
CREATE INDEXbtree (the default index type) only; CONCURRENTLY is not supported
CREATE LANGUAGE
CREATE MATERIALIZED VIEW
CREATE OPERATOR
CREATE OPERATOR CLASS
CREATE OPERATOR FAMILY
CREATE POLICY
CREATE PROCEDURESupports PL/pgSQL, SQL, and C procedures
CREATE PUBLICATION
CREATE RULE
CREATE SCHEMA
CREATE SEQUENCE
CREATE SERVER
CREATE STATISTICS
CREATE SUBSCRIPTION
CREATE TABLEUNLOGGED, storage parameters, and TABLESPACE are not supported
CREATE TABLE … PARTITIONPARTITIONs are parsed, but ignored
CREATE TABLESPACE
CREATE TEXT SEARCH CONFIGURATION
CREATE TEXT SEARCH DICTIONARY
CREATE TEXT SEARCH PARSER
CREATE TEXT SEARCH TEMPLATE
CREATE TRANSFORM
CREATE TRIGGERRow-level BEFORE/AFTER INSERT/UPDATE/DELETE only; CONSTRAINT, INSTEAD OF, FOR EACH STATEMENT, UPDATE OF, REFERENCING, and TRUNCATE triggers are not supported
CREATE TYPEComposite, enum, and shell types; RANGE and base types are not supported
CREATE VIEWTEMPORARY and RECURSIVE views are not supported
DROP ACCESS METHOD
DROP AGGREGATE
DROP CAST
DROP COLLATION
DROP CONVERSION
DROP DATABASEWITH (FORCE) is not supported
DROP DOMAIN
DROP EVENT TRIGGER
DROP EXTENSION
DROP FOREIGN DATA WRAPPER
DROP FOREIGN TABLE
DROP FUNCTION
DROP INDEXRESTRICT, CASCADE, CONCURRENTLY, and dropping multiple indexes at once are not supported
DROP LANGUAGE
DROP MATERIALIZED VIEWExecutes as DROP VIEW; CREATE MATERIALIZED VIEW is not supported
DROP OPERATOR
DROP OPERATOR CLASS
DROP OPERATOR FAMILY
DROP OWNED
DROP POLICY
DROP PROCEDURE
DROP PUBLICATION
DROP ROUTINE
DROP RULE
DROP SCHEMACASCADE is not supported
DROP SEQUENCE
DROP SERVER
DROP STATISTICS
DROP SUBSCRIPTION
DROP TABLERESTRICT and CASCADE are not supported
DROP TABLESPACE
DROP TEXT SEARCH CONFIGURATION
DROP TEXT SEARCH DICTIONARY
DROP TEXT SEARCH PARSER
DROP TEXT SEARCH TEMPLATE
DROP TRANSFORM
DROP TRIGGERRESTRICT and CASCADE are not supported
DROP TYPE
DROP VIEWRESTRICT and CASCADE are not supported
SECURITY LABEL

Data manipulation statements#

SQL CommandsSupportedNotes and limitations
CALL
CLOSE
CREATE TABLE ASWITH NO DATA is not supported
CLUSTER
COPY🟠COPY FROM STDIN and COPY FROM file work for text and CSV formats; COPY TO and the BINARY format are not supported
DECLARE
DELETESupports RETURNING
DO
FETCH
IMPORT FOREIGN SCHEMA
INSERTSupports ON CONFLICT DO NOTHING / DO UPDATE and RETURNING
LOAD
MERGE
MOVE
REFRESH MATERIALIZED VIEW
REINDEX
SELECTLocking clauses (FOR UPDATE / FOR SHARE) are not supported
SELECT INTO
TRUNCATEOne table at a time; RESTRICT and CASCADE are not supported
UPDATESupports RETURNING
VACUUMAccepted as a no-op; vacuuming is not needed in Doltgres
VALUES

Prepared statements#

SQL CommandsSupportedNotes and limitations
DEALLOCATE
PREPARESQL-level PREPARE is not supported; prepared statements via the wire protocol work
EXECUTESQL-level EXECUTE is not supported; prepared statements via the wire protocol work

Session management statements#

SQL CommandsSupportedNotes and limitations
DISCARDOnly DISCARD ALL is supported
RESET
SETSET LOCAL is not supported
SET CONSTRAINTS
SET ROLE
SET SESSION AUTHORIZATION
SET TRANSACTION
SHOWSHOW ALL is not supported

Transactional statements#

SQL CommandsSupportedNotes and limitations
ABORT
BEGINIsolation level, priority, and deferrable options are not supported
CHECKPOINT
COMMIT
COMMIT PREPARED
END
LISTEN
LOCK
NOTIFY
PREPARE TRANSACTION
RELEASE SAVEPOINT
ROLLBACK
ROLLBACK PREPARED
ROLLBACK TO SAVEPOINT
SAVEPOINT
START TRANSACTIONIsolation level, priority, and deferrable options are not supported
UNLISTEN

Utility statements#

SQL CommandsSupportedNotes and limitations
ANALYZE
EXPLAINEXPLAIN SELECT is supported; other statements are not