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.

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.
  • Reuse the same KalamDB WITH (...) table options from PostgreSQL.
  • Forward arbitrary statements directly to KalamDB with SELECT kalam_exec('<sql>').
  • Set kalam.user_id per session for user-scoped tables.

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
CREATE TABLE ... USING kalamdbAvailablePublic authoring syntax for PostgreSQL-managed KalamDB tables
KalamDB WITH (...) optionsAvailableTable 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()
IMPORT FOREIGN SCHEMANot yet availableRemote mode currently rejects it

Start Here

  1. Getting Started
  2. Architecture
  3. SQL Syntax
  4. Status & Limits

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 kalam_exec(...) when you want to send a KalamDB statement directly without a PostgreSQL wrapper.
Last updated on