Variant
pg-value
Postgres data values, usable as parameters or via queries see: https://www.postgresql.org/docs/current/datatype.html
variant pg-value {
null,
big-int(s64),
int8(s64),
int8-array(list<s64>),
big-serial(s64),
serial8(s64),
bool(bool),
boolean(bool),
bool-array(list<bool>),
double(hashable-f64),
float8(hashable-f64),
float8-array(list<hashable-f64>),
real(hashable-f32),
float4(hashable-f32),
float4-array(list<hashable-f32>),
integer(s32),
int(s32),
int4(s32),
int4-array(list<s32>),
numeric(numeric),
decimal(numeric),
numeric-array(list<numeric>),
serial(u32),
serial4(u32),
small-int(s16),
int2(s16),
int2-array(list<s16>),
int2-vector(list<s16>),
int2-vector-array(list<list<s16>>),
small-serial(s16),
serial2(s16),
bit(tuple<u32, list<u8>>),
bit-array(list<tuple<u32, list<u8>>>),
bit-varying(tuple<option<u32>, list<u8>>),
varbit(tuple<option<u32>, list<u8>>),
varbit-array(list<tuple<option<u32>, list<u8>>>),
bytea(list<u8>),
bytea-array(list<list<u8>>),
char(tuple<u32, list<u8>>),
char-array(list<tuple<u32, list<u8>>>),
varchar(tuple<option<u32>, list<u8>>),
varchar-array(list<tuple<option<u32>, list<u8>>>),
cidr(string),
cidr-array(list<string>),
inet(string),
inet-array(list<string>),
macaddr(mac-address-eui48),
macaddr-array(list<mac-address-eui48>),
macaddr8(mac-address-eui64),
macaddr8-array(list<mac-address-eui64>),
box(tuple<lower-left-point, upper-right-point>),
box-array(list<tuple<lower-left-point, upper-right-point>>),
circle(tuple<center-point, radius>),
circle-array(list<tuple<center-point, radius>>),
line(tuple<start-point, end-point>),
line-array(list<tuple<start-point, end-point>>),
lseg(tuple<start-point, end-point>),
lseg-array(list<tuple<start-point, end-point>>),
path(list<point>),
path-array(list<list<point>>),
point(point),
point-array(list<point>),
polygon(list<point>),
polygon-array(list<list<point>>),
date(date),
date-array(list<date>),
interval(interval),
interval-array(list<interval>),
time(time),
time-array(list<time>),
time-tz(time-tz),
time-tz-array(list<time-tz>),
timestamp(timestamp),
timestamp-array(list<timestamp>),
timestamp-tz(timestamp-tz),
timestamp-tz-array(list<timestamp-tz>),
json(string),
json-array(list<string>),
jsonb(string),
jsonb-array(list<string>),
money(numeric),
money-array(list<numeric>),
pg-lsn(u64),
pg-lsn-array(list<u64>),
pg-snapshot(tuple<xmin, xmax, xip-list>),
txid-snapshot(s64),
name(string),
name-array(list<string>),
text(string),
text-array(list<string>),
xml(string),
xml-array(list<string>),
ts-query(string),
ts-vector(list<lexeme>),
uuid(string),
uuid-array(list<string>),
hstore(list<tuple<string, option<string>>>),
}Cases
| Case | Payload | Description |
|---|---|---|
| null | — | |
| big-int | s64 | Numeric |
| int8 | s64 | |
| int8-array | list<s64> | |
| big-serial | s64 | |
| serial8 | s64 | |
| bool | bool | |
| boolean | bool | |
| bool-array | list<bool> | |
| double | hashable-f64 | |
| float8 | hashable-f64 | |
| float8-array | list<hashable-f64> | |
| real | hashable-f32 | |
| float4 | hashable-f32 | |
| float4-array | list<hashable-f32> | |
| integer | s32 | |
| int | s32 | |
| int4 | s32 | |
| int4-array | list<s32> | |
| numeric | numeric | |
| decimal | numeric | |
| numeric-array | list<numeric> | |
| serial | u32 | |
| serial4 | u32 | |
| small-int | s16 | |
| int2 | s16 | |
| int2-array | list<s16> | |
| int2-vector | list<s16> | |
| int2-vector-array | list<list<s16>> | |
| small-serial | s16 | |
| serial2 | s16 | |
| bit | tuple<u32, list<u8>> | note: matches tokio-postgres Bytes |
| bit-array | list<tuple<u32, list<u8>>> | |
| bit-varying | tuple<option<u32>, list<u8>> | |
| varbit | tuple<option<u32>, list<u8>> | |
| varbit-array | list<tuple<option<u32>, list<u8>>> | |
| bytea | list<u8> | |
| bytea-array | list<list<u8>> | |
| char | tuple<u32, list<u8>> | Characters TODO: specify text encoding, to negotiate possible component/DB mismatch? |
| char-array | list<tuple<u32, list<u8>>> | |
| varchar | tuple<option<u32>, list<u8>> | |
| varchar-array | list<tuple<option<u32>, list<u8>>> | |
| cidr | string | Networking |
| cidr-array | list<string> | |
| inet | string | |
| inet-array | list<string> | |
| macaddr | mac-address-eui48 | |
| macaddr-array | list<mac-address-eui48> | EUI-48 |
| macaddr8 | mac-address-eui64 | EUI-48 |
| macaddr8-array | list<mac-address-eui64> | EUI-64 (deprecated) |
| box | tuple<lower-left-point, upper-right-point> | EUI-64 (deprecated) Geo |
| box-array | list<tuple<lower-left-point, upper-right-point>> | |
| circle | tuple<center-point, radius> | |
| circle-array | list<tuple<center-point, radius>> | |
| line | tuple<start-point, end-point> | |
| line-array | list<tuple<start-point, end-point>> | |
| lseg | tuple<start-point, end-point> | |
| lseg-array | list<tuple<start-point, end-point>> | |
| path | list<point> | |
| path-array | list<list<point>> | |
| point | point | |
| point-array | list<point> | |
| polygon | list<point> | |
| polygon-array | list<list<point>> | |
| date | date | Date-time |
| date-array | list<date> | |
| interval | interval | |
| interval-array | list<interval> | |
| time | time | |
| time-array | list<time> | |
| time-tz | time-tz | |
| time-tz-array | list<time-tz> | |
| timestamp | timestamp | |
| timestamp-array | list<timestamp> | |
| timestamp-tz | timestamp-tz | |
| timestamp-tz-array | list<timestamp-tz> | |
| json | string | JSON |
| json-array | list<string> | |
| jsonb | string | |
| jsonb-array | list<string> | |
| money | numeric | Money (use is discouraged) |
| money-array | list<numeric> | |
| pg-lsn | u64 | Postgres-internal |
| pg-lsn-array | list<u64> | |
| pg-snapshot | tuple<xmin, xmax, xip-list> | see: https://www.postgresql.org/docs/current/functions-info.html#FUNCTIONS-PG-SNAPSHOT-PARTS |
| txid-snapshot | s64 | |
| name | string | Text |
| name-array | list<string> | |
| text | string | |
| text-array | list<string> | |
| xml | string | |
| xml-array | list<string> | |
| ts-query | string | Full Text Search |
| ts-vector | list<lexeme> | |
| uuid | string | UUIDs |
| uuid-array | list<string> | |
| hstore | list<tuple<string, option<string>>> | Containers |