Expand description
Miscellaneous extensions: generate_series, decimal, uuid (§14.7).
Provides three independent extension families:
-
generate_series(START, STOP [, STEP]): virtual table that generates a sequence of integers, commonly used in joins and CTEs.
-
Decimal arithmetic: exact string-based decimal operations that avoid floating-point precision loss. Functions:
decimal,decimal_add,decimal_sub,decimal_mul,decimal_cmp. -
UUID generation:
uuid()generates random UUID v4 strings,uuid_strconverts blob to string,uuid_blobconverts string to blob.
Structs§
- Decimal
AddFunc decimal_add(X, Y)— exact decimal addition.- Decimal
CmpFunc decimal_cmp(X, Y)— compare two decimals, returning -1, 0, or 1.- Decimal
Func decimal(X)— convert a value to canonical decimal text.- Decimal
MulFunc decimal_mul(X, Y)— exact decimal multiplication.- Decimal
SubFunc decimal_sub(X, Y)— exact decimal subtraction.- Generate
Series Cursor - Cursor for iterating over a generated integer series.
- Generate
Series Table - Virtual table that generates a sequence of integers.
- Uuid
Blob Func uuid_blob(X)— convert a UUID string to a 16-byte blob.- Uuid
Func uuid()— generate a random UUID v4 string.- Uuid
StrFunc uuid_str(X)— convert a 16-byte UUID blob to its string representation.
Functions§
- extension_
name - register_
misc_ scalars - Register all miscellaneous scalar functions.