Expand description
PostgreSQL 18’s values: their input and output functions, comparisons, arithmetic and casts.
Structs§
- Array
Dim - One dimension of an array, its lower bound and its length.
- Char
Length - The length of a
varchar(n)orchar(n)type, in characters. - Input
Context - The session state PostgreSQL’s input functions read, which the caller supplies.
- Interval
Sum - The running state of PostgreSQL’s
sum(interval)andavg(interval). - Interval
Typmod - The modifier of an interval type, the fields it keeps and the fractional-second digits it
rounds to, where the default is plain
interval. - NonFinite
Numeric - Why a
numerichas noBigDecimal, which holds finite values alone. - Numeric
Typmod - The modifier of a
numeric(p, s)type, the precision and scale it rounds to. - PgArray
- An array of
PgValues over its dimensions, in row-major order, equal, ordered and hashed asarray_eqandbtarraycmpcompare it, and printed asarray_outprints it under the defaultDateStyleofISO. - PgBpchar
- A
bpcharorchar(n)value, held as written or as a row image carries it, blank-padded to its length. - PgBytea
- A PostgreSQL
bytea, ordered asbyteacmporders it and printed asbyteaoutprints it under the defaultbytea_outputofhex. - PgDate
- A PostgreSQL
date, days from 2000-01-01, from 4714-11-24 BC to 5874897-12-31 and the two infinities, ordered as PostgreSQL orders it. - PgFloat8
- A PostgreSQL
double precision, equal, ordered and hashed asfloat8_cmp_internalcompares it, withNaNequal to itself and aboveInfinity, and-0equal to0. - PgInterval
- A PostgreSQL
intervalas months, days and microseconds, equal, ordered and hashed by PostgreSQL’s span with a month as 30 days and a day as 24 hours. - PgJsonb
- A PostgreSQL
jsonbvalue, its object keys injsonb’s storage order with the last of duplicate keys kept, equal, ordered and hashed asjsonb’s btree operator class compares it. - PgNumeric
- A PostgreSQL
numeric, equal, ordered and hashed by value ascmp_numericscompares it, withNaNequal to itself and aboveInfinity. - PgTime
- A PostgreSQL
time, microseconds from midnight to 24:00:00 inclusive. - PgTime
Tz - A PostgreSQL
timetz, a time of day with the offset east of UTC it was written with, ordered by the instant and then by the offset, astimetz_cmporders it. - PgTime
Zone - A time zone as PostgreSQL’s
TimeZonesetting reads it, equal to another whenSHOW timezonenames both alike. - PgTimestamp
- A PostgreSQL
timestamp, microseconds from 2000-01-01 00:00:00, from 4714-11-24 BC to 294276-12-31 23:59:59.999999 and the two infinities. - PgTimestamp
Tz - A PostgreSQL
timestamptz, the instant as microseconds from 2000-01-01 00:00:00 UTC, over the range ofPgTimestamp, printed as underTimeZoneUTC. - Time
Zone Abbreviations - A
timezone_abbreviationsset, the abbreviations a literal may write for its zone.
Enums§
- Bytea
Error - Why
byteainrefuses a text, one variant per message it raises. - Cast
Error - Why PostgreSQL refuses a cast, one variant per message it raises, or why this crate declines to answer for it.
- Cast
Target - The type a literal or value is cast to, with its modifier.
- Cast
Value - The value a cast produces or takes, printed by
Displayas the type’s output function prints it under the defaultDateStyleofISO. - Date
Arithmetic Error - Why PostgreSQL refuses
datearithmetic or the cast of a date totimestamp, one variant per message it raises. - Date
Order DateOrder, the field order ofDateStylefor a date written in numbers alone.- Date
Time Error - Why PostgreSQL refuses a date or time, one variant per message it raises, or why this crate cannot answer for it without more session state or a wider zone database.
- Float8
Error - Why
float8inrefuses a text, one variant per message it raises. - Integer
Type - A PostgreSQL integer type, ordered from the narrowest to the widest.
- Interval
Error - Why PostgreSQL refuses to read an interval or to compute one, one variant per message it raises.
- Interval
Fields - The fields an interval type keeps, as in
interval day to second. - Jsonb
Error - Why
jsonb_inrefuses a text, one variant per detail PostgreSQL gives, each printed as PostgreSQL’s message and detail without the token it quotes. - Jsonb
Kind - The kind of a top-level
jsonbvalue, ascannotCastJsonbValuenames it when a cast to a scalar type refuses it. - Literal
- A literal as written before
::, its quotes and escapes already decoded. - Numeric
Error - Why PostgreSQL refuses to read or compute a
numeric, one variant per message it raises. - PgType
- A type PostgreSQL names in a cast’s error, printed as
format_typenames it. - PgValue
- A known
boolean, integer,numeric,text,date,timestamp,jsonbor array value, equal, ordered and hashed as PostgreSQL’s comparison operators compare it. - Shift
Error - Why a timestamp or time shifted by an interval has no value here.
- Time
Zone Abbreviations Error - Why PostgreSQL refuses a time zone abbreviation file, one variant per message
tzparser.craises. - Time
Zone Error - Why PostgreSQL refuses a
TimeZonesetting, one variant per message or detail it raises.
Functions§
- cast_
literal - The value PostgreSQL 18’s explicit cast
literal::targetproduces, or the error it raises, with a database encoding of UTF-8. - cast_
value - The value PostgreSQL 18’s explicit cast
value::targetproduces,NoneforNULL, or the error it raises. - number_
constant - The value PostgreSQL 18 makes of a numeric constant, written as
Literal::Numbertakes it, as its lexer andmake_consttype it. An integer is anintegerwhen it fits, else abigintwhen it fits, else anumeric, and a constant with a point or an exponent is anumeric. - parse_
date - Parse a
YYYY-MM-DDdate with a year of four or more digits and PostgreSQL’s trailingBC, orinfinityand-infinity. Year0000, as MySQL and SQLite print 1 BC, is year 0. - parse_
interval - Parse an interval as PostgreSQL 18’s
interval_inreads it under the defaultIntervalStyle. - parse_
interval_ typmod - Parse an interval literal of a restricted type as
interval '…' <fields>reads it, which differs from casting a text value to that type. - parse_
time - Parse
HH:MM:SS[.f]with one to nine fraction digits, rounded to the microsecond, up to 24:00:00. - parse_
timestamp - Parse
YYYY-MM-DD HH:MM:SS[.f]with a space orTseparator, a year of four or more digits, PostgreSQL’s trailingBC, andinfinityand-infinity, the fraction rounded to the microsecond. Year0000, as MySQL and SQLite print 1 BC, is year 0. - parse_
timestamp_ tz - Parse a
parse_timestamplayout followed by aZ,±HH,±HHMM,±HH:MMor±HH:MM:SSoffset, then PostgreSQL’s optionalBC, orinfinityand-infinity.