PostgreSQL Extension
In Development
The pg_kalam PostgreSQL extension lets PostgreSQL define and use KalamDB tables with PostgreSQL-shaped SQL while forwarding the real table definition and execution to a running KalamDB server.
Prebuilt release assets are published on the KalamDB GitHub Releases page for the current Linux x86_64 PostgreSQL extension target. Other platforms or PostgreSQL majors can still be built from source with pgrx.
This chapter documents the current supported remote-mode surface. The extension is usable today, but it is still in development and some PostgreSQL FDW features remain intentionally unavailable.
What You Can Do Today
- Download the prebuilt
pg_kalamrelease package or build it from source, then install it into PostgreSQL. - Point a foreign server at KalamDB after the extension binaries are installed.
- Define KalamDB tables with
CREATE TABLE ... USING kalamdb. - Use
SELECT,INSERT,UPDATE, andDELETEfrom PostgreSQL against Kalam-backed tables. - Reuse the same KalamDB
WITH (...)table options from PostgreSQL. - Forward arbitrary statements directly to KalamDB with
SELECT kalam_exec('<sql>'). - Set
kalam.user_idper session for user-scoped tables.
Current Capability Map
| Area | Status | Notes |
|---|---|---|
| Remote bridge | Available | Current compiled mode is remote |
| Shared table DML | Available | SELECT, INSERT, UPDATE, DELETE work through FDW callbacks |
| User table DML | Available | Set kalam.user_id before tenant-scoped work |
CREATE TABLE ... USING kalamdb | Available | Public authoring syntax for PostgreSQL-managed KalamDB tables |
KalamDB WITH (...) options | Available | Table options are forwarded to the server as-is |
| Direct statement passthrough | Available | kalam_exec(...) sends SQL directly to KalamDB |
| Extension helper functions | Available | Includes kalam_* metadata helpers and SNOWFLAKE_ID() |
IMPORT FOREIGN SCHEMA | Not yet available | Remote mode currently rejects it |
Start Here
Recommended Workflow
Use the PostgreSQL extension when you want PostgreSQL tooling, SQL clients, or migrations to operate against KalamDB tables without switching your operators to the HTTP API or an SDK.
In most cases the flow is:
- Download the matching
pg_kalamrelease asset for your PostgreSQL major, or build it from source. - Install the extension into the exact PostgreSQL instance you will use.
- Create a
kalam_serverforeign server that points at KalamDB’s gRPC endpoint. - Define tables with
CREATE TABLE ... USING kalamdb. - Set
kalam.user_idin sessions that work with user-scoped tables. - Use
kalam_exec(...)when you want to send a KalamDB statement directly without a PostgreSQL wrapper.