kt_fdw
kt_fdw · Foreign data wrapper for reading and writing Kyoto Tycoon key-value stores.
Overview
Usage
Sources:
- Official README at the reviewed commit
- Version 0.0.1 SQL objects
- FDW implementation
- Optional Kyoto Tycoon transaction procedures
kt_fdw maps a Kyoto Tycoon key-value database to a writable PostgreSQL foreign table. It supports reads plus insert, update, and delete, but the upstream repository is archived and the code targets old PostgreSQL and Kyoto Tycoon APIs. Rebuild and integration-test it for the exact versions in an isolated environment before considering use.
Core Workflow
Define a server endpoint and a foreign table with exactly two columns: the key first and the value second.
The only reviewed server options are host (default 127.0.0.1), port (default 1978), and timeout (default -1). There are no extension options for authentication, TLS, or a remote database number, so keep the endpoint on a trusted private network.
Query and Write Semantics
A simple equality predicate on the first column can become one remote key lookup. Other scans walk the entire remote cursor and leave filtering to PostgreSQL. Both columns must be non-NULL. Insert uses Kyoto Tycoon’s add operation and fails if the key already exists; update can change only the value, not the key.
Transactional writes require compiling the extension with its transaction support, building Kyoto Tycoon with Lua, and loading the supplied transactions.lua procedures on the server. Even then, savepoints and prepared transactions are unsupported. Without that setup, remote writes do not follow PostgreSQL transaction rollback. Treat cross-system failures and retries as application-visible consistency events.