Skip to Content
Status & Limits

PostgreSQL Extension Status and Limits

In Development

The PostgreSQL extension is usable, but it is still an active development surface. Plan for incremental feature growth rather than assuming complete PostgreSQL FDW parity.

Supported Today

  • Remote-mode PostgreSQL bridge to a running KalamDB server
  • Shared and user table reads and writes through FDW callbacks
  • Stream-table authoring and normal FDW access outside explicit transactions
  • Explicit BEGIN, COMMIT, and ROLLBACK transaction blocks for Kalam-backed tables
  • CREATE TABLE ... USING kalamdb as the public PostgreSQL-side authoring syntax
  • Auto-injected system columns: _seq on all tables and _userid on user tables
  • Forwarding KalamDB table options from PostgreSQL WITH (...)
  • Direct pass-through execution with kalam_exec(...)
  • Session-scoped tenant routing with kalam.user_id
  • Extension helper functions including kalam_version() and SNOWFLAKE_ID()

Hard Limits and Current Constraints

AreaCurrent behavior
Compile modekalam_compiled_mode() currently reports remote; this chapter documents that mode only
DDL hookCREATE TABLE ... USING kalamdb requires shared_preload_libraries = 'pg_kalam' and a PostgreSQL restart
Default server bindingCREATE TABLE ... USING kalamdb and kalam_exec(...) currently assume the default foreign server name kalam_server
Schema importIMPORT FOREIGN SCHEMA is not available in remote mode
Runtime mapping sourceRelation schema and relation name are the runtime namespace and table; OPTIONS (namespace, table) are not the canonical scan/write mapping
Filter pushdownOnly simple equality filters are pushed down; PostgreSQL still reapplies quals locally
Order and limit pushdownORDER BY and LIMIT are not pushed down today
User scopingUser-table operations should set kalam.user_id; _userid is only an explicit INSERT override
kalam.user_id privilegeskalam.user_id is registered as a PostgreSQL SUSET parameter
Row identity for UPDATE/DELETEThe current FDW path uses the first non-system column as its row-identity heuristic
Explicit transactionsThe documented surface is top-level BEGIN, COMMIT, and ROLLBACK blocks
DDL in transactionsDDL is rejected inside explicit transactions
Stream tables in transactionsStream-table writes are rejected inside explicit transactions
Direct SQL helperkalam_exec(text) is revoked from PUBLIC and does not automatically mirror PostgreSQL search_path or current schema
Type conversionsThe logical mapping is broader than the extension’s dedicated PostgreSQL runtime branches; see Data Type Conversions
Reserved columns_seq, _userid, and _deleted are reserved names; only _seq and _userid are auto-injected into the current PostgreSQL relation surface

Additional practical limits:

  • _seq is read-only metadata projected from KalamDB. Values supplied in INSERT or UPDATE are not forwarded.
  • Multi-row user-table INSERT statements must use one _userid value consistently.
  • UPDATE and DELETE on user tables use the session kalam.user_id scope. Reassigning ownership through _userid updates is not supported.
  • The server and table validators are permissive. Some bad option combinations fail on first use rather than at CREATE SERVER or CREATE FOREIGN TABLE time.

Prototype Syntax vs Supported Syntax

This docs section focuses on the current remote-mode flow.

If you see older prototype scripts that mention experimental helpers such as schema opt-in functions, treat those as development artifacts unless they are covered in this chapter. The supported documentation surface today is:

  • CREATE EXTENSION
  • CREATE SERVER / ALTER SERVER / DROP SERVER
  • CREATE TABLE ... USING kalamdb
  • BEGIN / COMMIT / ROLLBACK
  • kalam_exec(...)
  • SELECT, INSERT, UPDATE, DELETE
  • extension helper functions and kalam.user_id

Troubleshooting

SymptomLikely causeWhat to check
extension "pg_kalam" is not availableExtension files are not installed into the active PostgreSQL instanceReinstall the extension into that PostgreSQL 16 installation
could not access file "$libdir/pg_kalam"PostgreSQL cannot find the shared libraryVerify the extension was installed into the correct PostgreSQL library directory
CREATE TABLE ... USING kalamdb does not mirror DDLThe preload hook is not activeCheck SHOW shared_preload_libraries and confirm it includes pg_kalam, then restart PostgreSQL
Remote connection failureThe foreign-server host or port is wrong, the HTTP API port was used, or KalamDB is downVerify the foreign server options and point them at the KalamDB RPC endpoint
Auth failuresauth_header is missing or staleUpdate the foreign server definition with the right bearer token or shared secret
User-table reads or writes failkalam.user_id was not set, or the role cannot set itSet kalam.user_id in the PostgreSQL session and verify the PostgreSQL role can change SUSET parameters
permission denied for function kalam_execkalam_exec(text) is revoked from PUBLICUse a superuser or GRANT EXECUTE ON FUNCTION kalam_exec(text) to the desired role
UPDATE or DELETE targets the wrong rowThe table’s primary key is not the first user columnRecreate the table with the primary key first or use a carefully controlled direct SQL path
IMPORT FOREIGN SCHEMA failsFeature gap in current remote modeUse CREATE TABLE ... USING kalamdb or kalam_exec(...) instead
Last updated on