SQL API Reference
Signatures match the installed extension SQL today. Prefer named arguments so optional parameters stay readable. Positional calls remain valid.
Session helpers
| Function | Returns | Meaning |
|---|---|---|
snowflake_id() | bigint | Monotonic Snowflake-like id |
koldstore_version() | text | Extension version |
koldstore_user_id() | text | Active koldstore.user_id, or NULL |
koldstore.preload_status() | jsonb | Preload / merge-scan status |
Public GUCs
| GUC | Default | Meaning |
|---|---|---|
koldstore.user_id | empty | Scope id for user-typed managed tables |
koldstore.cold_reads | auto | auto / on / off (off errors when cold is required) |
koldstore.enable_merge_scan | on | off → ERROR at exec (never silent hot-only) |
koldstore.max_open_parquet_readers | 32 | Per-backend open reader cap (1..=1024) |
koldstore.max_merge_seen_keys | 1000000 | Per-scan PK identity cap; 0 disables |
koldstore.log_level | info | error / warn / info / debug / trace |
koldstore.min_max_rows_per_file | 1000 | Floor for max_rows_per_file |
koldstore.flush_check_interval_seconds | 30 | Auto-flush worker tick (1..=86400) |
koldstore.async_apply_poll_interval_ms | 100 | Apply loop latch poll (50..=5000) |
koldstore.async_apply_max_rows_per_tick | 0 | Max source changes per tick (0 = unlimited) |
koldstore.async_apply_max_ms_per_tick | 0 | Max ms per tick (0 = unlimited) |
koldstore.flush_prelock_max_passes | 3 | Flush phase-5.5 pre-lock apply passes |
koldstore.flush_prelock_max_ms | 5000 | Flush phase-5.5 wall budget |
koldstore.async_mirror_max_retained_bytes | 1 GiB | Health threshold only — never blocks apply |
Internal GUCs (internal_system_write, internal_flush_cleanup) are reserved
for extension maintenance paths and cannot be set by application roles.
Configure durable settings with ALTER SYSTEM / ALTER DATABASE / ALTER ROLE
and follow PostgreSQL reload rules. Session SET does not always reach the
background worker.
Function catalog
| Function | Returns |
|---|---|
koldstore.register_storage(...) | uuid |
koldstore.alter_storage_credentials(...) | void |
koldstore.alter_storage_location(...) | uuid |
koldstore.manage_table(...) | uuid (migration job id) |
koldstore.set_table_auto_flush(...) | boolean |
koldstore.unmanage_table(...) | bigint |
koldstore.wait_for_async_mirror() | bigint |
koldstore.async_mirror_status() | jsonb |
koldstore.async_mirror_slot_name() | text |
koldstore.disable_async_mirror() | boolean |
koldstore.enqueue_flush_job(...) | bigint (1 / 0) |
koldstore.flush_table(...) | uuid |
koldstore.list_jobs(...) | jsonb array |
koldstore.cancel_job(...) / cancel_table_jobs(...) | cancel status |
koldstore.describe_table(...) | jsonb |
koldstore.recover_segments(...) | bigint |
koldstore.changes_since(...) | set of change rows |
Storage
Default path templates: {namespace}/{tableName}/ and
{namespace}/{tableName}/{scopeId}/.
Manage / unmanage
See Manage & Flush for parameters and policy examples. Quick reference:
Async mirror
Flush and jobs
Change feed
Full semantics: Change Feed.
Not shipped yet (do not call)
Documented as roadmap / ops intent only:
- Cold DML helpers (
hydrate_pk, coldupdate_row/delete_row) backup_manifest,validate_cold_storage, packaged export/import- Packaged
ALTER EXTENSION … UPDATEedges
Standard SQL UPDATE/DELETE that only matches cold rows affects zero
hot rows in the current MVP — use unmanage/rehydrate paths when you need cold
rows back in the heap.