Hologres is compatible with PostgreSQL and supports the SQL statements listed on this page. For PostgreSQL-compatible statements not covered by Hologres-specific documentation, see the PostgreSQL 11 documentation.
Not all PostgreSQL features are supported. Where Hologres imposes restrictions—such as onCREATE TABLEandSELECT—the supported subset is noted in the description.
Statement categories
| Category | Statements |
|---|---|
| Data Definition Language (DDL) | ALTER TABLE, ALTER DATABASE, CREATE TABLE, CREATE DATABASE, CREATE VIEW, DROP TABLE, DROP DATABASE, TRUNCATE, and more |
| Data Manipulation Language (DML) | SELECT, INSERT, UPDATE, DELETE, VALUES |
| Transaction Control Language (TCL) | BEGIN, COMMIT, ROLLBACK, END, SAVEPOINT, RELEASE SAVEPOINT, SET TRANSACTION, START TRANSACTION |
| Data Control Language (DCL) | GRANT, REVOKE, ALTER DEFAULT PRIVILEGES |
| Cursor and session | CLOSE, FETCH, DISCARD, SET, SHOW, RESET |
| Utility | ANALYZE, EXPLAIN, PREPARE, EXECUTE, DEALLOCATE, CALL, COMMENT, VACUUM |
A
| SQL statement | Description |
|---|---|
| ALTER DATABASE | Modifies a database. |
| ALTER DEFAULT PRIVILEGES | Defines default access privileges. |
| ALTER FOREIGN DATA WRAPPER | Modifies a foreign data wrapper (FDW). |
| ALTER FOREIGN TABLE | Modifies a foreign table. |
| ALTER GROUP | Modifies a group. |
| ALTER LANGUAGE | Changes the procedural language. |
| ALTER ROLE | Modifies a database role. |
| ALTER SCHEMA | Modifies a schema. |
| ALTER SERVER | Modifies an external server. |
| ALTER TABLE | Modifies a table. Changes to a parent partitioned table propagate automatically to child partitioned tables. For partitioned and foreign tables, see ALTER PARTITION TABLE and ALTER FOREIGN TABLE. |
| ALTER USER | Changes a database role. |
| ALTER USER MAPPING | Modifies a user mapping. |
| ALTER VIEW | Changes a view. |
| ANALYZE | Updates table statistics. |
B
| SQL statement | Description |
|---|---|
| BEGIN | Starts a transaction. Supported only with data definition language (DDL) statements. |
C
| SQL statement | Description |
|---|---|
| CALL | Calls a stored procedure or function. |
| CLOSE | Closes a cursor. |
| COMMENT | Defines or changes the comment on a database object. |
| COMMIT | Commits a transaction. Supported only with DDL statements. |
| CREATE DATABASE | Creates a database. |
| CREATE EXTENSION | Creates an extension. |
| CREATE FOREIGN DATA WRAPPER | Creates an FDW. |
| CREATE FOREIGN TABLE | Creates a foreign table. Hologres supports only foreign tables sourced from MaxCompute. |
| CREATE GROUP | Creates a user group. |
| CREATE LANGUAGE | Creates a procedural language. |
| CREATE MATERIALIZED VIEW | Creates a materialized view. |
| CREATE ROLE | Creates a database role. |
| CREATE SCHEMA | Creates a schema. |
| CREATE SERVER | Creates an external server. |
| CREATE TABLE | Creates a table. The following PostgreSQL features are not supported: UNLOGGED, TEMP, IF NOT EXISTS, LIKE, CHECK, DEFAULT, GENERATED, UNIQUE, EXCLUDE, FOREIGN KEY, DEFERRABLE, WITH OIDS, GLOBAL, and LOCAL. Only list partitions are supported; PARTITION BY LIST fields must be of the STRING type and contain unique values. |
| CREATE TABLE AS | Creates a table from query results. |
| CREATE USER | Creates a user. |
| CREATE USER MAPPING | Creates a user mapping. |
| CREATE VIEW | Creates a view. |
D
| SQL statement | Description |
|---|---|
| DEALLOCATE | Releases a prepared statement. |
| DELETE | Deletes rows from a table. |
| DISCARD | Clears session state. |
| DROP DATABASE | Drops a database. |
| DROP FOREIGN DATA WRAPPER | Drops an FDW. |
| DROP FOREIGN TABLE | Drops a foreign table. |
| DROP GROUP | Drops a user group. |
| DROP MATERIALIZED VIEW | Drops a materialized view. |
| DROP OWNED | Drops database objects owned by a database role. |
| DROP ROLE | Drops a role. |
| DROP SCHEMA | Drops a schema. |
| DROP SERVER | Drops an external server. |
| DROP TABLE | Drops a table. |
| DROP USER | Drops a user. |
| DROP USER MAPPING | Drops a user mapping. |
| DROP VIEW | Drops a view. |
E
| SQL statement | Description |
|---|---|
| END | Commits a transaction. Supported only with DDL statements. |
| EXECUTE | Executes a prepared statement. |
| EXPLAIN | Shows the execution plan for a query. |
F
| SQL statement | Description |
|---|---|
| FETCH | Retrieves rows from a query using a cursor. |
G
| SQL statement | Description |
|---|---|
| GRANT | Grants access privileges. |
I
| SQL statement | Description |
|---|---|
| INSERT | Inserts rows into a table. |
P
| SQL statement | Description |
|---|---|
| PREPARE | Prepares a statement for execution. |
R
| SQL statement | Description |
|---|---|
| REASSIGN OWNED | Transfers ownership of database objects to another database role. |
| RELEASE SAVEPOINT | Removes a savepoint defined in the current transaction. |
| RESET | Resets a runtime parameter to its default value. |
| REVOKE | Revokes access privileges. |
| ROLLBACK | Rolls back a transaction. |
S
| SQL statement | Description |
|---|---|
| SAVEPOINT | Defines a savepoint in the current transaction. |
| SELECT | Queries data from a table. The following PostgreSQL features are not supported: WITH RECURSIVE, TABLESAMPLE, LOCKING, and ONLY. |
| SELECT INTO | Creates a new table from query results. |
| SET | Sets a Grand Unified Configuration (GUC) parameter. For supported parameters, see GUC parameters. |
| SET ROLE | Sets the current role identifier for the session. |
| SET SESSION AUTHORIZATION | Sets the session and current user identifiers for the current session. |
| SET TRANSACTION | Sets characteristics of the current transaction. |
| SHOW | Shows the current value of a runtime parameter. |
| START TRANSACTION | Starts a transaction block. |
T
| SQL statement | Description |
|---|---|
| TRUNCATE | Removes all rows from a table or set of tables. |
U
| SQL statement | Description |
|---|---|
| UPDATE | Updates rows in a table. |
V
| SQL statement | Description |
|---|---|
| VACUUM | Reclaims storage and optionally analyzes a database. |
| VALUES | Returns a set of rows computed from given values. |