← All Adapters

POSTGRESQL

type: postgres

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

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
    connection: pg_ops    # points to profiles.yml output
    schema: public
    tables:
      - name: customers
      - name: orders
      - name: products

INCREMENTAL STRATEGIES

Append Delete+Insert Merge