PostgreSQL type input functions (pg_type.typinput) for the scalar types whose text form has one meaning: bool, the integers, oid, float4/float8, numeric and uuid. Ported from boolin (bool.c), pg_strtoint16/32/64_safe and uint32in_subr (numutils.c), float4in/float8in (float.c), numeric_in and uuid_in.
Every path that turns text into one of these types -- an untyped
literal meeting a typed operand, a cast from text or unknown, a text
parameter (PgParamCodec calls in), an array element, COPY -- goes
through parse. Invalid
input raises 22P02 and out-of-range input 22003, with PostgreSQL's
messages; nothing returns the text it could not parse.
Carriers: bool -> Boolean; int2/int4/int8/oid -> Long; float4 -> Float; float8 -> Double; numeric -> BigDecimal (or the NaN/Infinity carrier); uuid -> java.util.UUID.
PostgreSQL type input functions (pg_type.typinput) for the scalar types whose text form has one meaning: bool, the integers, oid, float4/float8, numeric and uuid. Ported from boolin (bool.c), pg_strtoint16/32/64_safe and uint32in_subr (numutils.c), float4in/float8in (float.c), numeric_in and uuid_in. Every path that turns text into one of these types -- an untyped literal meeting a typed operand, a cast from text or unknown, a text parameter (PgParamCodec calls in), an array element, COPY -- goes through `parse`. Invalid input raises 22P02 and out-of-range input 22003, with PostgreSQL's messages; nothing returns the text it could not parse. Carriers: bool -> Boolean; int2/int4/int8/oid -> Long; float4 -> Float; float8 -> Double; numeric -> BigDecimal (or the NaN/Infinity carrier); uuid -> java.util.UUID.
(parse oid s)Read s as a value of type oid with PostgreSQL's input function,
raising its error on invalid input. nil for nil.
Read `s` as a value of type `oid` with PostgreSQL's input function, raising its error on invalid input. nil for nil.
(parse-bool s)boolin: surrounding whitespace ignored; any prefix of true/false/yes/no, on/off (at least two characters: 'o' alone is ambiguous), 1 or 0, case insensitive.
boolin: surrounding whitespace ignored; any prefix of true/false/yes/no, on/off (at least two characters: 'o' alone is ambiguous), 1 or 0, case insensitive.
(parse-float4 s)float4in: parsed as a double (strtod), then range-checked for real.
float4in: parsed as a double (strtod), then range-checked for real.
(parse-float8 s)float8in: strtod over the trimmed input; out of range (overflow to infinity, or underflow to zero) raises 22003.
float8in: strtod over the trimmed input; out of range (overflow to infinity, or underflow to zero) raises 22003.
(parse-oid s)oidin (uint32in_subr): strtoul with base 0 -- 0x hex, a leading 0 for
octal -- and surrounding whitespace. A minus sign is accepted for
backward compatibility when the negated value fits int32, and wraps
into uint32: -1 is 4294967295.
oidin (uint32in_subr): strtoul with base 0 -- 0x hex, a leading 0 for octal -- and surrounding whitespace. A minus sign is accepted for backward compatibility when the negated value fits int32, and wraps into uint32: `-1` is 4294967295.
(parse-uuid s)uuid_in: 32 hex digits, optionally in braces, with an optional hyphen after any group of four; no surrounding whitespace.
uuid_in: 32 hex digits, optionally in braces, with an optional hyphen after any group of four; no surrounding whitespace.
(parser oid)The input function for oid, or nil when that type's input is not
handled here.
The input function for `oid`, or nil when that type's input is not handled here.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |