---
type: "post"
id: "postgresql-governed-host-integration-151557"
slug: "postgresql-governed-host-integration-151557"
title: "PostgreSQL governed host integration"
description: "The versioned ODAP Gateway guide documents a PostgreSQL read connector exposed through authenticated REST, with MCP command hooks available after initialization."
retrieval_nugget: "The versioned ODAP Gateway guide documents a PostgreSQL read connector exposed through authenticated REST, with MCP command hooks available after initialization."
published_at: "2026-11-27"
updated_at: "2026-11-27"
record_date: "2026-11-27"
date_kind: "published_at"
topics: ["mcp"]
entities: ["ODAP Gateway","PostgreSQL","Model Context Protocol"]
related_patterns: ["agent-security-moves-to-runtime-boundaries","agent-protocols-become-interoperability-layer"]
novelty_label: "new_fact"
what_changed: null
prior_refs: []
source_url: "https://github.com/open-data-agent-platform/odap-gateway/blob/v0.3.0-preview.1/docs/POSTGRESQL_CONNECTOR.md"
source_urls: ["https://github.com/open-data-agent-platform/odap-gateway/blob/v0.3.0-preview.1/docs/POSTGRESQL_CONNECTOR.md"]
production: {"schema":"newruntime-production-v1","desk":"newsroom","first_seen_at":"2026-11-27T19:21:52.129Z","independent_sources":1,"notes_synthesized":null,"writer_model":"gpt-6-luna","critic":null,"checks":["primary_source_verified","source_fresh","one_story","copy_contract"],"novelty":null,"editorial_value":"medium","human_review":"selective"}
citations: [{"claim":"","quotes":["The versioned guide documents a restricted Node.js PostgreSQL connector with authenticated REST and MCP hooks, not a deployed Cloudflare Worker query endpoint.","This is a Node host integration, not a deployed Cloudflare Worker query endpoint or full PostgreSQL"],"cite_url":"https://github.com/open-data-agent-platform/odap-gateway/blob/v0.3.0-preview.1/docs/POSTGRESQL_CONNECTOR.md#:~:text=The%20versioned%20guide%20documents%20a%20restricted%20Node.js%20PostgreSQL%20connector%20with%20authenticated%20REST%20and%20MCP%20hooks%2C%20not%20a%20deployed%20Cloudflare%20Worker%20query%20endpoint.&text=This%20is%20a%20Node%20host%20integration%2C%20not%20a%20deployed%20Cloudflare%20Worker%20query%20endpoint%20or%20full%20PostgreSQL","source_url":"https://github.com/open-data-agent-platform/odap-gateway/blob/v0.3.0-preview.1/docs/POSTGRESQL_CONNECTOR.md","publisher":"github.com"},{"claim":"","quotes":["One ordinary, non-inherited, non-partitioned table with active RLS.","Released single-table COUNT_ROWS or SUM of smallint/integer/bigint/numeric.","Equality filters for built-in text, boolean, smallint, integer, bigint, numeric, uuid, date, time, timestamp, timestamptz only."],"cite_url":"https://github.com/open-data-agent-platform/odap-gateway/blob/v0.3.0-preview.1/docs/POSTGRESQL_CONNECTOR.md#:~:text=One%20ordinary%2C%20non%2Dinherited%2C%20non%2Dpartitioned%20table%20with%20active%20RLS.&text=Released%20single%2Dtable%20COUNT_ROWS%20or%20SUM%20of%20smallint%2Finteger%2Fbigint%2Fnumeric.&text=Equality%20filters%20for%20built%2Din%20text%2C%20boolean%2C%20smallint%2C%20integer%2C%20bigint%2C%20numeric%2C%20uuid%2C%20date%2C%20time%2C%20timestamp%2C%20timestamptz%20only.","source_url":"https://github.com/open-data-agent-platform/odap-gateway/blob/v0.3.0-preview.1/docs/POSTGRESQL_CONNECTOR.md","publisher":"github.com"},{"claim":"","quotes":["Tenant predicate is mandatory, uses a bound parameter and C collation, and supplements rather than replaces database RLS.","The release digest and odap.metric-read.v1 action are checked before connecting.","Parameter strings are bound, never interpolated.","Aggregates return exact decimal strings or null, never floating-point numbers."],"cite_url":"https://github.com/open-data-agent-platform/odap-gateway/blob/v0.3.0-preview.1/docs/POSTGRESQL_CONNECTOR.md#:~:text=Tenant%20predicate%20is%20mandatory%2C%20uses%20a%20bound%20parameter%20and%20C%20collation%2C%20and%20supplements%20rather%20than%20replaces%20database%20RLS.&text=The%20release%20digest%20and%20odap.metric%2Dread.v1%20action%20are%20checked%20before%20connecting.&text=Parameter%20strings%20are%20bound%2C%20never%20interpolated.&text=Aggregates%20return%20exact%20decimal%20strings%20or%20null%2C%20never%20floating%2Dpoint%20numbers.","source_url":"https://github.com/open-data-agent-platform/odap-gateway/blob/v0.3.0-preview.1/docs/POSTGRESQL_CONNECTOR.md","publisher":"github.com"},{"claim":"","quotes":["Arrays, JSON, floating-point, binary, domains, custom types, joins, arbitrary SQL, functions, views, foreign tables and pagination are not supported.","Virtual generated columns (introduced in PostgreSQL 18) are computed on reads and are refused before claim, whether used as a measure, filter"],"cite_url":"https://github.com/open-data-agent-platform/odap-gateway/blob/v0.3.0-preview.1/docs/POSTGRESQL_CONNECTOR.md#:~:text=Arrays%2C%20JSON%2C%20floating%2Dpoint%2C%20binary%2C%20domains%2C%20custom%20types%2C%20joins%2C%20arbitrary%20SQL%2C%20functions%2C%20views%2C%20foreign%20tables%20and%20pagination%20are%20not%20supported.&text=Virtual%20generated%20columns%20%28introduced%20in%20PostgreSQL%2018%29%20are%20computed%20on%20reads%20and%20are%20refused%20before%20claim%2C%20whether%20used%20as%20a%20measure%2C%20filter","source_url":"https://github.com/open-data-agent-platform/odap-gateway/blob/v0.3.0-preview.1/docs/POSTGRESQL_CONNECTOR.md","publisher":"github.com"},{"claim":"","quotes":["The guide lists PostgreSQL 15.20, 16.16, 17.12, and 18.7 as the supported builds and says other builds are rejected."],"cite_url":"https://github.com/open-data-agent-platform/odap-gateway/blob/v0.3.0-preview.1/docs/POSTGRESQL_CONNECTOR.md#:~:text=The%20guide%20lists%20PostgreSQL%2015.20%2C%2016.16%2C%2017.12%2C%20and%2018.7%20as%20the%20supported%20builds%20and%20says%20other%20builds%20are%20rejected.","source_url":"https://github.com/open-data-agent-platform/odap-gateway/blob/v0.3.0-preview.1/docs/POSTGRESQL_CONNECTOR.md","publisher":"github.com"},{"claim":"","quotes":["matrix pins an official Linux amd64 image digest for every listed build and runs the same complete synthetic engine suite, including RLS, exact types, configured TLS/MCP, cancellation and eight process-crash cases.","certify a managed service, fork, replica topology or untested patch release."],"cite_url":"https://github.com/open-data-agent-platform/odap-gateway/blob/v0.3.0-preview.1/docs/POSTGRESQL_CONNECTOR.md#:~:text=matrix%20pins%20an%20official%20Linux%20amd64%20image%20digest%20for%20every%20listed%20build%20and%20runs%20the%20same%20complete%20synthetic%20engine%20suite%2C%20including%20RLS%2C%20exact%20types%2C%20configured%20TLS%2FMCP%2C%20cancellation%20and%20eight%20process%2Dcrash%20cases.&text=certify%20a%20managed%20service%2C%20fork%2C%20replica%20topology%20or%20untested%20patch%20release.","source_url":"https://github.com/open-data-agent-platform/odap-gateway/blob/v0.3.0-preview.1/docs/POSTGRESQL_CONNECTOR.md","publisher":"github.com"},{"claim":"","quotes":["These are local engineering formats, not changes to the ODAP specification.","generation expressions at write time and RLS policy functions remain trusted; this is not a sandbox for administrator-controlled database behavior.","The offline inspector still refuses production Gateway dispatch."],"cite_url":"https://github.com/open-data-agent-platform/odap-gateway/blob/v0.3.0-preview.1/docs/POSTGRESQL_CONNECTOR.md#:~:text=These%20are%20local%20engineering%20formats%2C%20not%20changes%20to%20the%20ODAP%20specification.&text=generation%20expressions%20at%20write%20time%20and%20RLS%20policy%20functions%20remain%20trusted%3B%20this%20is%20not%20a%20sandbox%20for%20administrator%2Dcontrolled%20database%20behavior.&text=The%20offline%20inspector%20still%20refuses%20production%20Gateway%20dispatch.","source_url":"https://github.com/open-data-agent-platform/odap-gateway/blob/v0.3.0-preview.1/docs/POSTGRESQL_CONNECTOR.md","publisher":"github.com"},{"claim":"","quotes":["npm run postgresql:build","This emits CommonJS JavaScript and TypeScript declarations under dist/postgresql/. It does not start a server, read environment credentials,"],"cite_url":"https://github.com/open-data-agent-platform/odap-gateway/blob/v0.3.0-preview.1/docs/POSTGRESQL_CONNECTOR.md#:~:text=npm%20run%20postgresql%3Abuild&text=This%20emits%20CommonJS%20JavaScript%20and%20TypeScript%20declarations%20under%20dist%2Fpostgresql%2F.%20It%20does%20not%20start%20a%20server%2C%20read%20environment%20credentials%2C","source_url":"https://github.com/open-data-agent-platform/odap-gateway/blob/v0.3.0-preview.1/docs/POSTGRESQL_CONNECTOR.md","publisher":"github.com"}]
schema_version: "newruntime-agent-readable-v0.2"
stable_id: "post:postgresql-governed-host-integration-151557"
status: "published"
visuals: []
editor: {"role":"editor","name":"Andrey Reshetnikov","profile":"https://newruntime.com/owner-profile.md","profile_json":"https://newruntime.com/owner-profile.json","same_as":["https://www.linkedin.com/in/reshetnikov1/","https://t.me/lapetuse"]}
routes: {"html":"https://newruntime.com/posts/postgresql-governed-host-integration-151557/","markdown":"https://newruntime.com/posts/postgresql-governed-host-integration-151557.md","json":"https://newruntime.com/posts/postgresql-governed-host-integration-151557.json"}
markdown_url: "https://newruntime.com/posts/postgresql-governed-host-integration-151557.md"
---

# PostgreSQL governed host integration

## Retrieval answer

The versioned ODAP Gateway guide documents a PostgreSQL read connector exposed through authenticated REST, with MCP command hooks available after initialization.

## Summary

The versioned ODAP Gateway guide documents a PostgreSQL read connector exposed through authenticated REST, with MCP command hooks available after initialization. It runs in a Node host; it is not a deployed Cloudflare Worker query endpoint. ([github.com](https://github.com/open-data-agent-platform/odap-gateway/blob/v0.3.0-preview.1/docs/POSTGRESQL_CONNECTOR.md#:~:text=The%20versioned%20guide%20documents%20a%20restricted%20Node.js%20PostgreSQL%20connector%20with%20authenticated%20REST%20and%20MCP%20hooks%2C%20not%20a%20deployed%20Cloudflare%20Worker%20query%20endpoint.&text=This%20is%20a%20Node%20host%20integration%2C%20not%20a%20deployed%20Cloudflare%20Worker%20query%20endpoint%20or%20full%20PostgreSQL))

## What happened

Reads target one ordinary table that is neither inherited nor partitioned, and require active row-level security. Supported operations are released single-table `COUNT_ROWS` or `SUM` aggregates; sums accept `smallint`, `integer`, `bigint` or `numeric`. Equality filters are limited to `text`, `boolean`, `smallint`, `integer`, `bigint`, `numeric`, `uuid`, `date`, `time`, `timestamp` and `timestamptz`. ([github.com](https://github.com/open-data-agent-platform/odap-gateway/blob/v0.3.0-preview.1/docs/POSTGRESQL_CONNECTOR.md#:~:text=One%20ordinary%2C%20non%2Dinherited%2C%20non%2Dpartitioned%20table%20with%20active%20RLS.&text=Released%20single%2Dtable%20COUNT_ROWS%20or%20SUM%20of%20smallint%2Finteger%2Fbigint%2Fnumeric.&text=Equality%20filters%20for%20built%2Din%20text%2C%20boolean%2C%20smallint%2C%20integer%2C%20bigint%2C%20numeric%2C%20uuid%2C%20date%2C%20time%2C%20timestamp%2C%20timestamptz%20only.))

A bound tenant predicate is mandatory and supplements, rather than replaces, database RLS. The connector checks the release digest and `odap.metric-read.v1` action before connecting; parameter strings are bound, not interpolated. Results are exact decimal strings or `null`, never floating-point numbers. ([github.com](https://github.com/open-data-agent-platform/odap-gateway/blob/v0.3.0-preview.1/docs/POSTGRESQL_CONNECTOR.md#:~:text=Tenant%20predicate%20is%20mandatory%2C%20uses%20a%20bound%20parameter%20and%20C%20collation%2C%20and%20supplements%20rather%20than%20replaces%20database%20RLS.&text=The%20release%20digest%20and%20odap.metric%2Dread.v1%20action%20are%20checked%20before%20connecting.&text=Parameter%20strings%20are%20bound%2C%20never%20interpolated.&text=Aggregates%20return%20exact%20decimal%20strings%20or%20null%2C%20never%20floating%2Dpoint%20numbers.))

Joins, arbitrary SQL, functions, views, foreign tables and pagination are unsupported. Virtual generated columns and unknown generation kinds are refused before claim. ([github.com](https://github.com/open-data-agent-platform/odap-gateway/blob/v0.3.0-preview.1/docs/POSTGRESQL_CONNECTOR.md#:~:text=Arrays%2C%20JSON%2C%20floating%2Dpoint%2C%20binary%2C%20domains%2C%20custom%20types%2C%20joins%2C%20arbitrary%20SQL%2C%20functions%2C%20views%2C%20foreign%20tables%20and%20pagination%20are%20not%20supported.&text=Virtual%20generated%20columns%20%28introduced%20in%20PostgreSQL%2018%29%20are%20computed%20on%20reads%20and%20are%20refused%20before%20claim%2C%20whether%20used%20as%20a%20measure%2C%20filter))

The supported PostgreSQL builds are exactly 15.20, 16.16, 17.12 and 18.7; other builds, including unlisted patch releases, are rejected. The listed builds use `pg` 8.23.1. ([github.com](https://github.com/open-data-agent-platform/odap-gateway/blob/v0.3.0-preview.1/docs/POSTGRESQL_CONNECTOR.md#:~:text=The%20guide%20lists%20PostgreSQL%2015.20%2C%2016.16%2C%2017.12%2C%20and%2018.7%20as%20the%20supported%20builds%20and%20says%20other%20builds%20are%20rejected.))

## Trend signal

The design puts the read boundary in runtime checks: a tenant predicate and action check constrain access alongside database RLS. That aligns with the broader pattern of treating runtime controls—not prompts—as the durable security boundary for agents, but does not remove other trust assumptions.

## Why it matters

The host operator must mount one long-lived `createPostgresGateway` handler in an existing Request/Response bridge or use the loopback listener. The module does not provision an OAuth provider or public deployment; its optional HTTP service binds only to `127.0.0.1`, so external access requires a separately approved TLS reverse proxy.

PostgreSQL control migrations are opt-in and have not been applied to the production D1 database. The optional SQLite control binding is separate from business-data querying: it accepts only Node 24.22.1 and requires an existing local file with the exact schema fingerprint from migrations 0001–0039. It is for the control plane, not querying SQLite business data.

## Limits and uncertainty

The CI matrix uses pinned official Linux amd64 image digests for the listed PostgreSQL builds and runs a synthetic engine suite covering RLS, exact types, configured TLS/MCP, cancellation and process-crash cases. Those observations do not certify managed services, forks, replica topologies or untested patch releases. ([github.com](https://github.com/open-data-agent-platform/odap-gateway/blob/v0.3.0-preview.1/docs/POSTGRESQL_CONNECTOR.md#:~:text=matrix%20pins%20an%20official%20Linux%20amd64%20image%20digest%20for%20every%20listed%20build%20and%20runs%20the%20same%20complete%20synthetic%20engine%20suite%2C%20including%20RLS%2C%20exact%20types%2C%20configured%20TLS%2FMCP%2C%20cancellation%20and%20eight%20process%2Dcrash%20cases.&text=certify%20a%20managed%20service%2C%20fork%2C%20replica%20topology%20or%20untested%20patch%20release.))

The guide describes the metric definition and action formats as local engineering formats, not changes to the ODAP specification. Database owners, write-time generation expressions and RLS policy functions remain trusted; the connector is not a sandbox for administrator-controlled database behavior. The offline inspector also refuses production Gateway dispatch. ([github.com](https://github.com/open-data-agent-platform/odap-gateway/blob/v0.3.0-preview.1/docs/POSTGRESQL_CONNECTOR.md#:~:text=These%20are%20local%20engineering%20formats%2C%20not%20changes%20to%20the%20ODAP%20specification.&text=generation%20expressions%20at%20write%20time%20and%20RLS%20policy%20functions%20remain%20trusted%3B%20this%20is%20not%20a%20sandbox%20for%20administrator%2Dcontrolled%20database%20behavior.&text=The%20offline%20inspector%20still%20refuses%20production%20Gateway%20dispatch.))

## Skill to build now

From the repository, run `npm ci` followed by `npm run postgresql:build`. This emits CommonJS JavaScript and TypeScript declarations under `dist/postgresql/`; it does not start a server, read environment credentials, create a database or apply migrations. ([github.com](https://github.com/open-data-agent-platform/odap-gateway/blob/v0.3.0-preview.1/docs/POSTGRESQL_CONNECTOR.md#:~:text=npm%20run%20postgresql%3Abuild&text=This%20emits%20CommonJS%20JavaScript%20and%20TypeScript%20declarations%20under%20dist%2Fpostgresql%2F.%20It%20does%20not%20start%20a%20server%2C%20read%20environment%20credentials%2C))

## Reader takeaway

This is a host module for authenticated, restricted aggregate reads—not a ready-made hosted endpoint. It fits workloads that can be expressed as single-table counts or sums under existing row-level security, on one of four exact PostgreSQL builds. Builders must provide the host, authorization setup and database configuration themselves.

Editor: [Andrey Reshetnikov](https://newruntime.com/owner-profile.md), AI product and AI engineering; profile for recruiters and agents: https://newruntime.com/owner-profile.json

## Continue in the graph

Next records for an agent, linked to their Markdown twins. Replace `.md` with `.json` for structured fields, including `next_reads`.

- topic hub: [Mcp](https://newruntime.com/topics/mcp.md): Explore the mcp topic hub.
- collection: [Field Notes](https://newruntime.com/posts.json): Open the latest editorial analysis.
- collection: [Sources](https://newruntime.com/sources/): See the original sources this archive cites.
- whole graph: [discovery graph](https://newruntime.com/discovery-graph.json) (typed nodes and edges) and [site index](https://newruntime.com/site-index.md)
