Registry: crates/types/src/registry.rs (PG-17 OIDs), crates/types/src/column.rs, parser crates/sql/src/parser/types.rs.
| Family | Names | Notes |
|---|---|---|
| Integers | `smallint | int2, integer |
| Float | `real | float4, double |
| Exact | `numeric | decimal |
| Text | text, `varchar |
character varying[(n)], CHAR→varchar` |
| Bool | `boolean | bool` |
| Date/time | date, `time [with |
without tz], timestamp […], timestamptz, interval` |
| JSON | json, jsonb |
Json(String) vs canonical Jsonb(Vec<u8>) |
| UUID | uuid |
|
| Binary | bytea, bit B'…' |
|
| Network | inet, oid, name |
macaddr, tsvector runtime values exist |
| Geometric/range | point…circle, int4range…, multiranges |
value support; range constructors int4range, multirange |
| Arrays | TYPE[] |
ARRAY[…], arr[i] 1-based |
| User | CREATE TYPE … AS ENUM / AS (cols), CREATE DOMAIN … |
OIDs from 16384 |
PgType::can_be_column_type() rejects pseudo-types (record only via ROW(…) value). (n)/(n,m) typmod encoded via encode_typmod. Multi-word names preserved for casts/DDL.
CREATE TABLE t (
a INT, b BIGINT, c NUMERIC(12,2), d TEXT, e VARCHAR(10),
f BOOLEAN, g DATE, h TIMESTAMPTZ, i INTERVAL, j JSONB, k TEXT[], l UUID
);
SELECT 1::bigint, 'x'::text, '[1,2]'::jsonb, B'0101';Related: Type conversion · Constraints
Was this page helpful? Thanks — noted locally, nothing is sent anywhere.