PostgreSQL front-end

Names and data types

Identifiers, schemas and the PostgreSQL data types and how each is stored.

Names are folded to lower case unless quoted. public.t is the engine table t; another schema s.t is the table s__t (the name prefix of the MSSQL front-end). CREATE SCHEMA records the schema; search_path, SET, RESET, SHOW work. Temporary tables are engine temporary tables of the session.

PostgreSQLengine columnanswers as
smallint, integer, bigintSMALLINT, INT, BIGINTint2, int4, int8
serial, bigserial, smallserial, GENERATED .. AS IDENTITYthe integer type with a default NEXTVAL(seq) of a sequence t_col_seq made with the tableint4, int8, int2
numeric(p,s), numericDECIMAL(p,s), DECIMAL(65,30) (printed without trailing zeros)numeric with the declared modifier
real, double precisionFLOAT, DOUBLEfloat4, float8 (text as PostgreSQL prints it: 0.1, 1e+20)
text, varchar(n), char(n)LONGTEXT, VARCHAR(n), CHAR(n) (padded to n on output)text, varchar, bpchar
booleanTINYINT(1)bool (t/f)
date, time, timestamp, timestamptzDATE, TIME(6), DATETIME(6) (timestamptz is kept in UTC and printed in the session's time zone)same
uuidCHAR(36) (lower case)uuid
jsonbJSON (printed the way PostgreSQL stores it: keys by length then bytes, ": " and ", ")jsonb
jsonLONGTEXT (kept as written)json
byteaLONGTEXT holding the hex text \x0aff (functions work on the bytes)bytea
intervaltext (months, days and microseconds, with arithmetic)interval
timetztext of 18 digits: the UTC time and the offset, sorting as PostgreSQL orders the valuestimetz
a domain (CREATE DOMAIN)the column of its base type; its NOT NULL and CHECK constraints are checked where a value is assigned or castthe base type
an enum (CREATE TYPE .. AS ENUM)DOUBLE: the sort order of the labelthe enum's own type, the label as text
a composite type (CREATE TYPE .. AS (..))JSON: an array of the fieldsthe type's own, the record text (1,x)
integer[], text[], numeric(p,s)[], ... (two dimensions)JSON (a JSON array: numbers, booleans, strings, null)_int4, _text, ... printed as {1,2,"a b",NULL}

The PostgreSQL type of every column is kept in __pg_col and every expression is typed on the way (1 + 1 is integer, 7 / 2 is 3, 7.0 / 2 is 3.5000000000000000, sum(integer) is bigint), so answers carry PostgreSQL's OIDs and modifiers and values are printed by type.