← All Adapters
POSTGRESQL
type: postgresOpen-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
| FIELD | TYPE | REQUIRED | DEFAULT | DESCRIPTION |
|---|---|---|---|---|
| type | string | yes | — | Must be `postgres` |
| host | string | yes | localhost | Database server hostname or IP |
| port | integer | no | 5432 | Database server port |
| user | string | yes | — | Database username |
| password | string | yes | — | Database password. Use `{{ env_var('PG_PASSWORD') }}` |
| dbname | string | yes | — | Database name |
| schema | string | no | public | Default schema for models |
| threads | integer | no | 4 | Number of parallel threads |
| sslmode | string | no | prefer | SSL 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: 4SOURCES.YML EXAMPLE
sources:
- name: operational_db
connection: pg_ops # points to profiles.yml output
schema: public
tables:
- name: customers
- name: orders
- name: productsINCREMENTAL STRATEGIES
✓ Append✓ Delete+Insert✓ Merge