Postgres
Configure PostgreSQL as the engine for your Data Product.
PostgreSQL suits smaller products, prototypes, and local-first work where you want direct control over the database. It's the engine behind the orders-analytics example used throughout this guide. Use the postgres adapter to connect. For the full reference, see the Postgres engine manual in References.
Before you start
A PostgreSQL server (version 12 or higher recommended).
A database user with the required permissions.
Network connectivity from Vulcan to the server, and the connection details: host, port, database, user, password.
connection.databasemust already exist beforevulcan plan: Postgres has no catalog tier, and Vulcan doesn't create the database itself.DataOS access: a
roles:id:data-dev-equivalent role tag,depot:rw:<postgres-depot-name>(ordepot:rfor read-only), Can Use on Compute/Depots/Secrets, and a git-sync Secret.
Permissions
CREATE on the database
Creating schemas
CREATE on schemas
Creating tables and views
SELECT, INSERT, UPDATE, DELETE on tables
Reading and writing model output
USAGE on schemas
Accessing schemas Vulcan uses
Three roles are required — don't collapse them into one: a superuser/DBA admin (creates the database, installs extensions, grants privileges), the Vulcan service role (runs models, creates and modifies schemas/tables), and a consumer role (read-only on Data Product tables). Grant the service role as a superuser or database owner:
GRANT CONNECT ON DATABASE warehouse TO vulcan;
GRANT CREATE ON DATABASE warehouse TO vulcan;
GRANT USAGE ON SCHEMA raw TO vulcan;
GRANT SELECT ON ALL TABLES IN SCHEMA raw TO vulcan;Grant consumers read-only access the same way, with CONNECT / USAGE / SELECT instead. Verify with \dn and \dp raw.* in psql.
Connection options
type
Yes
Must be postgres
host
Yes
Server hostname
port
Yes
Server port
database
Yes
Database name
user
Yes
Connection username
password
Yes
Connection password
sslmode
No
SSL mode. Use require in production.
connect_timeout, keepalives_idle, role, application_name
No
Tune as your environment needs
Authentication methods
Username and password (required): set
userandpassword.SSL mode (optional): set
sslmode: requireor stricter for secure connections in production.
Example
Supported model kinds
SEED, FULL, VIEW, INCREMENTAL_BY_TIME_RANGE, INCREMENTAL_BY_UNIQUE_KEY, INCREMENTAL_BY_PARTITION, INCREMENTAL_UNMANAGED, SCD_TYPE_2, SCD_TYPE_2_BY_TIME, SCD_TYPE_2_BY_COLUMN, and EMBEDDED. FULL drops and recreates the table each run; INCREMENTAL_BY_TIME_RANGE deletes the time_column window then inserts; INCREMENTAL_BY_UNIQUE_KEY uses a native MERGE on Postgres 15+ (logical merge fallback on earlier versions); INCREMENTAL_BY_PARTITION uses Vulcan's generic delete-plus-insert fallback, not native partition DDL. For the full mapping, see the Postgres engine manual.
Postgres folds unquoted identifiers to lowercase (the opposite of Snowflake and Spark's UPPERCASE convention). Author model names, columns, semantic references, and metric references in lowercase, or quote identifiers consistently everywhere.
Wrap DDL that should run only on real execution in pre_statements / post_statements, guarded with @IF(@runtime_stage = 'evaluating', ...), or vulcan plan executes it. Raw PL/pgSQL the parser can't interpret (anonymous DO $$ ... $$ blocks, CREATE FUNCTION ... LANGUAGE plpgsql) still runs, but logs a harmless "could not be semantically understood" warning — silence it with VULCAN_IGNORE_WARNINGS=1 or vulcan --ignore-warnings.
Limits and performance
A 1–2 vCPU, 2–4 GiB instance is usually enough for dev. Start concurrent_tasks at 2 for daily incrementals, and size max_connections for Vulcan workers, API replicas, and BI sessions together — each API replica consumes its own connections, so pair replica growth with PgBouncer or added connection capacity. Index the incremental time_column / unique_key, and for the semantic API and concurrent BI, add a pooler or read replica and watch the connection count.
If concurrency degrades, fix in order: remove cross-join-shaped queries, add missing indexes on hot filter/join columns, add a connection pooler such as PgBouncer, add a read replica for query traffic, then raise instance size last. On a 50M-row PostgreSQL 15.17 reference run, a primary-key lookup returned in ~49ms, a 3-way join aggregate took ~35s, and COUNT(DISTINCT ...) took ~28s — reproduce on your own instance before quoting numbers like these.
Troubleshooting
database "warehouse" does not exist
Target database missing or wrong name
Create the database; fix connection.database.
relation raw.raw_orders does not exist
Missing table, grant, or external declaration
Grant SELECT; add to inputs.yaml.
Semantic column does not exist
Casing mismatch
Use lowercase identifiers, or quote consistently everywhere.
unacceptable schema name "pg_..."
pg_ prefix reserved
Rename the schema.
vulcan plan runs DDL
Lifecycle DDL not guarded
Wrap it in @IF(@runtime_stage = 'evaluating', ...).
Too many connections for role
Workers + replicas + BI exceed budget
Lower concurrency/replicas; add PgBouncer.
psycopg2 fails to build from source
Local build lacks pg_config / libpq headers
Use the wheel/binary supplied by the Vulcan distribution.
For the full failure-mode table, health-check queries, and recovery procedures, see Troubleshooting in the Postgres engine manual. That manual also covers full-text search and row-level security recipes.
Once vulcan info succeeds, continue to Assets.
Last updated
Was this helpful?