← All Adapters
PostgreSQL logo

POSTGRESQL

type: postgres
FREE FOR INDIVIDUALS✓ VERIFIED IN DVT TEST SUITE

Open-source relational database. The most popular choice for on-premises analytics and operational data stores.

DVT SUPPORT

FEDERATION SOURCE

read in federation models

FEDERATION TARGET

materialize federation results

DEFAULT TARGET

run full dbt projects against it

SEED TARGET

dvt seed --target loads here

DVT supports PostgreSQLbecause both dbt and Sling do: dbt drives standard materializations when it's your default target, Sling moves data in and out during federation. Connectivity for both layers is checked with dvt debug --all.

PREREQUISITES

Driver: psycopg2 — installed automatically by:

dvt sync

CONFIGURATION FIELDS

FIELDTYPEREQUIREDDEFAULTDESCRIPTION
typestringyesMust be `postgres`
hoststringyeslocalhostDatabase server hostname or IP
portintegerno5432Database server port
userstringyesDatabase username
passwordstringyesDatabase password. Use `{{ env_var('PG_PASSWORD') }}`
dbnamestringyesDatabase name
schemastringnopublicDefault schema for models
threadsintegerno4Number of parallel threads
sslmodestringnopreferSSL mode: disable, require, verify-full, verify-ca

PROFILES.YML EXAMPLE

my_project:
  target: dev
  outputs:
    dev:
      type: postgres
      host: localhost
      port: 5432
      user: analytics
      password: "{{ env_var('PG_PASSWORD') }}"
      dbname: analytics_db
      schema: public
      threads: 4

SOURCES.YML EXAMPLE

sources:
  - name: operational_db
    meta:
      connection: pg_ops    # points to profiles.yml output
    schema: public
    tables:
      - name: customers
      - name: orders
      - name: products

DBT ADAPTER FEATURES

When PostgreSQL is your default target, every standard dbt model runs through the official dbt adapter — all of its documented capabilities apply unchanged:

MATERIALIZATIONS

tableviewincrementalephemeralmaterialized_viewf_tablef_incremental

INCREMENTAL STRATEGIES

appendmergedelete+insertmicrobatch

NOTABLE CONFIGS

  • indexes
  • unlogged tables
Official dbt PostgreSQL adapter docs ↗

FEDERATION INCREMENTAL STRATEGIES

Strategies available when this engine is the target of a f_incremental model:

Append Delete+Insert Merge