DateStyle = 'ISO, MDY' and a database created with the en_US.UTF-8 locale.
Tables on this page use these statuses:
Key differences
These differences change query results, mostly without raising an error. Check them first when you migrate a workload.Decimal literals are DOUBLE PRECISION, not NUMERIC
Decimal literals are DOUBLE PRECISION, not NUMERIC
NUMERIC '1.5' or '1.5'::NUMERIC(10, 2).NUMERIC defaults to NUMERIC(38, 9), and NUMERIC(p) has scale min(p, 9)
NUMERIC defaults to NUMERIC(38, 9), and NUMERIC(p) has scale min(p, 9)
NUMERIC(12, 0).NUMERIC multiplication, division, and avg keep the input scale
NUMERIC multiplication, division, and avg keep the input scale
avg of integers returns DOUBLE PRECISION, and extract returns INTEGER
avg of integers returns DOUBLE PRECISION, and extract returns INTEGER
avg over BIGINT values above 2^53 loses precision. Cast to NUMERIC where the exact result matters.Hexadecimal, octal, and binary literals are read as 0 with a column alias
Hexadecimal, octal, and binary literals are read as 0 with a column alias
Text sorts by byte value, as under the PostgreSQL C collation
Text sorts by byte value, as under the PostgreSQL C collation
COLLATE is not supported. The same order affects min, max, greatest, and least.VARCHAR(n) and CHAR(n) ignore the length and don't pad
VARCHAR(n) and CHAR(n) ignore the length and don't pad
substr and trim trailing blanks with rtrim.DATE and TIMESTAMP cover a narrower range
DATE and TIMESTAMP cover a narrower range
DATE spans 0001-01-01 to 9999-12-30, and TIMESTAMP and TIMESTAMPTZ end at 9999-12-30 22:00:00.999999. PostgreSQL accepts years from 4713 BC to 294276 AD for timestamps and to 5874897 AD for dates. Values outside the Firebolt range raise an error, including the common end-of-time value:Arrays are nested, not multidimensional
Arrays are nested, not multidimensional
a[i][j] to reach an element.JSON and JSONB are one type, normalized on input
JSON and JSONB are one type, normalized on input
TEXT and apply JSON functions to it.UNIQUE and PRIMARY KEY are not enforced, but the optimizer trusts them
UNIQUE and PRIMARY KEY are not enforced, but the optimizer trusts them
TEMPORARY tables are ordinary tables
TEMPORARY tables are ordinary tables
Views bind when queried, and schema changes don't check them
Views bind when queried, and schema changes don't check them
SELECT * view returns columns added to the table after the view was created. ALTER TABLE ... DROP COLUMN succeeds when a view uses the column, and the view then fails when queried; PostgreSQL refuses the drop. List view columns explicitly.Only snapshot isolation, with conflicts detected at COMMIT
Only snapshot isolation, with conflicts detected at COMMIT
READ COMMITTED: a second writer waits on the row lock and then succeeds. Firebolt has no locks; the first transaction to commit wins, and a later conflicting transaction fails at COMMIT. Retry the transaction on a conflict.Data types
These types work as in PostgreSQL:integer, bigint, real, double precision, bytea, and boolean. real and double precision print inf, -inf, and nan instead of Infinity, -Infinity, and NaN, and switch to exponent notation at 1e21 and 1e-6 rather than at PostgreSQL’s thresholds. See Data types for the Firebolt types.
smallint (use INTEGER), serial and identity columns, money, "char", name, time, timetz, uuid (use TEXT with gen_random_uuid_text()), composite and row types (use STRUCT), enum, domains, range types, network types, geometric types (use GEOGRAPHY), tsvector, tsquery, bit, xml, pg_lsn, and the other reg* types.
Literals
$tag$...$tag$), Unicode escape strings (U&'...'), bit strings (B'101', X'1F'), and array literals with explicit bounds ('[0:2]={1,2,3}').
Query syntax
CoreSELECT features work as in PostgreSQL, including joins, LATERAL, GROUPING SETS, subqueries, CTEs, and the default NULL ordering. Two precedence rules differ without an error; the remaining gaps raise errors.
Set operations and joins
Set operations and joins
NATURAL LEFT, NATURAL RIGHT, and NATURAL FULL joins (write them with USING), and USING (...) AS alias.SELECT, grouping, and limits
SELECT, grouping, and limits
DISTINCT ON; useQUALIFY row_number() OVER (PARTITION BY ... ORDER BY ...) = 1.GROUP BY DISTINCT.LIMIT ALL,OFFSET n ROWSwithoutFETCH,FETCH FIRST ROW ONLYwithout a count, andWITH TIES; useOFFSET nandFETCH FIRST 1 ROWS ONLY.- Bare
VALUES ... ORDER BYandTABLE t; useSELECT * FROM .... TABLESAMPLE,FOR UPDATE,FOR SHARE,ONLY, and system columns such asctid.
Subqueries, CTEs, and window frames
Subqueries, CTEs, and window frames
WITH RECURSIVE,SEARCH,CYCLE, and data-modifying statements inWITH.- Row comparisons such as
(a, b) < (c, d),ROW(...),SOME, andARRAY(subquery);(a, b) IN (SELECT ...)works. GROUPSframes,EXCLUDE, and refining a named window, as inOVER (w ORDER BY ...).
Identifiers and utility statements
Identifiers and utility statements
PREPARE and EXECUTE (drivers pass parameters), and bare user, current_role, current_schema, current_time, localtime, and system_user (use current_user and current_schema()).Functions and operators
Functions not mentioned here work as in PostgreSQL. Functions that exist only in Firebolt are documented in SQL functions.Casts and conditional expressions
Casts and conditional expressions
TRY_CAST, which returns NULL when a cast fails. Not available: to_number, to_char with a numeric or interval argument, IS UNKNOWN, BETWEEN SYMMETRIC, num_nulls, and num_nonnulls.String and pattern matching
String and pattern matching
C collation: by byte value, with case changes for ASCII letters only.concat_ws, initcap, chr, translate, overlay, quote_literal, quote_nullable, bit_length, normalize, string_to_table, LIKE ... ESCAPE, SIMILAR TO, LIKE ANY (array), and regexp_match, regexp_matches, regexp_substr, regexp_count, and the regexp_split_to_* functions (use REGEXP_EXTRACT_ALL).Math
Math
~ (bitwise NOT), @, |/, and ||/ (use abs, sqrt, cbrt), div, gcd, lcm, factorial, width_bucket, scale, min_scale, trim_scale, setseed, random(min, max), and the degree-based trigonometric functions such as sind.Date and time
Date and time
date_part (use extract), age, date_bin, make_date, make_timestamp, isfinite, OVERLAPS, current_time, localtime, clock_timestamp, statement_timestamp, transaction_timestamp, and timeofday.Aggregate and window functions
Aggregate and window functions
last_value, every (use bool_and), mode(), percentile_disc, regr_*, hypothetical-set aggregates, json_agg, jsonb_agg, and count(DISTINCT (a, b)).Array
Array
@>, <@, &&, and array || element (use ARRAY_CONTAINS, ARRAYS_OVERLAP, and ARRAY_CONCAT), slices, array_append, array_prepend, array_remove, array_replace, array_ndims, array_dims, array_lower, cardinality, and WITH ORDINALITY.JSON
JSON
(doc)['a'] or (doc).a.->, #>, #>> (use the subscript operator or JSON_VALUE), @>, ?, = on JSON, jsonb_array_length, jsonb_each, json_strip_nulls, jsonb_pretty, json_build_object, json_build_array, json_extract_path, json_array_elements, json_object_keys, jsonb_path_query, and row_to_json.System information and set-returning functions
System information and set-returning functions
generate_series over timestamps or NUMERIC, generate_subscripts, sha224, sha256, sha384, sha512, crc32, set_config, pg_backend_pid, txid_current, pg_sleep, inet_client_addr, obj_description, to_regclass, pg_get_viewdef, pg_get_constraintdef, and pg_table_size.Database objects
Firebolt supports tables, views, schemas, databases, roles, and users. It adds objects with no PostgreSQL counterpart: engines, locations, external tables, and aggregating indexes.row_number()), procedures, DO, CALL, triggers, rules, types, domains, enums, extensions, row-level security policies, foreign tables (use external tables or read_parquet and read_csv), CREATE STATISTICS (use ALTER TABLE ... ADD STATISTICS), tablespaces, collations, publications, and subscriptions.
Tables
CHECK, CONSTRAINT name, EXCLUDE, UNLOGGED, INHERITS, storage parameters, LIKE and WITH NO DATA (use CREATE TABLE new AS SELECT * FROM old LIMIT 0, or CREATE TABLE CLONE to copy the data too), ALTER COLUMN ... TYPE, SET and DROP DEFAULT, SET and DROP NOT NULL, ADD CONSTRAINT, and SET SCHEMA.
Views
WITH CHECK OPTION, TEMP and RECURSIVE views, ALTER VIEW ... RENAME TO, and dropping several views or tables in one statement.
Data manipulation
INSERT, UPDATE, DELETE, MERGE, and TRUNCATE work as in PostgreSQL, apart from the following.
RETURNING, UPDATE ... SET (a, b) = (...), MERGE ... INSERT DEFAULT VALUES, WITH in front of a data-modifying statement (write INSERT INTO t WITH x AS (...) SELECT ..., or use a subquery), and COPY ... FROM STDIN or TO STDOUT (Firebolt COPY FROM and COPY TO use object storage).
Access control
Users and roles are separate objects: privileges are granted to roles, and roles to users. EachGRANT names one privilege, one object, and one grantee. See Role-based access control.
WITH GRANT OPTION, REVOKE ... CASCADE, GRANT CONNECT or TEMPORARY ON DATABASE (use USAGE and CREATE ON DATABASE), REFERENCES and TRIGGER privileges, ALTER ROLE ... RENAME (ALTER USER ... RENAME works), ALTER USER ... WITH PASSWORD, SET ROLE, REASSIGN OWNED, DROP OWNED, and row-level security.
Transactions and sessions
READ COMMITTED, SERIALIZABLE, READ ONLY, SET TRANSACTION, SAVEPOINT, PREPARE TRANSACTION, SELECT ... FOR UPDATE, LOCK TABLE, SET search_path (qualify names with the schema), RESET, SET LOCAL, ANALYZE, REINDEX, CLUSTER, CHECKPOINT, DISCARD, LISTEN, and NOTIFY.
System catalog
information_schema and the common pg_catalog relations are available. Firebolt’s own catalog views are documented under Information schema.
referential_constraints, check_constraints, sequences, triggers, pg_proc, pg_roles, pg_auth_members, pg_index, pg_indexes, pg_stat_activity, pg_locks, pg_sequences, and pg_extension.