Documentation Index
Fetch the complete documentation index at: https://docs.goldsky.com/llms.txt
Use this file to discover all available pages before exploring further.
Overview
Write data to PostgreSQL databases with automatic table creation and upsert support. Compatible with managed Postgres providers like Neon, Supabase, and AWS RDS.Configuration
Parameters
Must be
postgres.Name of the transform or source to read data from.
PostgreSQL schema name (for example,
public, analytics). Created automatically if it doesn’t exist.Table name to write to. Created automatically if it doesn’t exist, with columns inferred from the upstream Arrow schema.
Name of a Goldsky secret holding the Postgres connection details (host, port, user, password, databaseName). See Secret format.
Comma-separated list of columns to use as the table’s primary key. When set, writes become upserts (
INSERT ... ON CONFLICT DO UPDATE). When omitted, writes are plain inserts and no primary key is added to the auto-created table.Behavior when a row with the same
primary_key already exists. update runs ON CONFLICT ... DO UPDATE SET, nothing runs ON CONFLICT ... DO NOTHING. Only applies when primary_key is set.Maximum number of rows to accumulate before flushing to Postgres. Falls back to the engine default when unset.
Maximum time to wait before flushing a partial batch, parsed as a humantime duration (for example,
"500ms", "1s", "2s"). Falls back to the engine default when unset.Number of parallel writer tasks. Each task processes a slice of the accumulated batch concurrently. Increase for sink-bound pipelines.
Secret format
Create the Postgres secret with the Goldsky CLI. The CLI accepts a standard Postgres connection string and stores it as a JDBC-style secret (host, port, user, password, databaseName):
Behavior
- Auto schema and table creation: Both the schema and the table are created with
CREATE ... IF NOT EXISTSon first write. Columns are derived from the upstream Arrow schema. - No automatic schema migrations: If the table already exists, the engine does not
ALTER TABLEto add or change columns. Upstream schema changes that add new columns will fail at insert time — drop or manually migrate the table first. - Upsert vs. insert: Setting
primary_keyproducesINSERT ... ON CONFLICT (<pk>) DO UPDATE SET .... Withoutprimary_key, rows are plainINSERTs and no primary key constraint is created. - Type mapping: Arrow types are mapped automatically —
Int32→INTEGER,Int64→BIGINT,Utf8→TEXT,Boolean→BOOLEAN,Decimal(p, s)→NUMERIC(p, s), structs/lists/maps →JSONB. - Large numbers: Blockchain
U256/I256values andUInt64are stored asNUMERIC.