Skip to Content
PostgreSQL ExtensionOverview

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.

KalamDB also publishes a ready-to-run Docker image with PostgreSQL and pg_kalam preinstalled at jamals86/pg-kalam on Docker Hub .

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_kalam release 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, and DELETE from PostgreSQL against Kalam-backed tables.
  • Use explicit BEGIN, COMMIT, and ROLLBACK blocks for atomic multi-statement work.
  • Reuse the same KalamDB table options through PostgreSQL WITH (...) clauses.
  • Forward arbitrary statements directly to KalamDB with SELECT kalam_exec('<sql>').
  • Set kalam.user_id per session for user-scoped tables.
  • Read _seq on all exposed PostgreSQL tables and _userid on user tables.
  • Observe active bridge sessions and explicit transactions with system.sessions and system.transactions.

Current Capability Map

AreaStatusNotes
Remote bridgeAvailableCurrent compiled mode is remote
Shared table DMLAvailableSELECT, INSERT, UPDATE, DELETE work through FDW callbacks
User table DMLAvailableSet kalam.user_id before tenant-scoped work
Explicit transactionsAvailableBEGIN, COMMIT, and ROLLBACK stage KalamDB writes until final commit
CREATE TABLE ... USING kalamdbAvailablePublic authoring syntax for PostgreSQL-managed KalamDB tables
System columnsAvailable_seq is auto-injected on all tables, read-only, and _userid is auto-injected on user tables
KalamDB table optionsAvailablePostgreSQL WITH (...) options are forwarded to the server as-is
Direct statement passthroughAvailablekalam_exec(...) sends SQL directly to KalamDB
Extension helper functionsAvailableIncludes kalam_* metadata helpers and SNOWFLAKE_ID()
Transaction observabilityAvailablesystem.sessions is pg-only; system.transactions covers all active explicit transactions
IMPORT FOREIGN SCHEMANot yet availableRemote mode currently rejects it

Start Here

  1. Getting Started
  2. Architecture
  3. SQL Syntax
  4. Status & Limits
  5. pg-kalam Docker image 

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:

  1. Download the matching pg_kalam release asset for your PostgreSQL major, or build it from source.
  2. Install the extension into the exact PostgreSQL instance you will use.
  3. Create a kalam_server foreign server that points at KalamDB’s gRPC endpoint.
  4. Define tables with CREATE TABLE ... USING kalamdb.
  5. Set kalam.user_id in sessions that work with user-scoped tables.
  6. Use BEGIN ... COMMIT when you need atomic multi-statement writes.
  7. Use kalam_exec(...) when you want to send a KalamDB statement directly without a PostgreSQL wrapper.
Last updated on