dbt PostgreSQL
Table of Contents
The dbt-postgres transformer uses SQL to transform data stored in your warehouse.
-
- Repository: https://github.com/dbt-labs/dbt-core
-
-
-
-
-
-
- Maintainer: dbt Labs
-
-
Getting Started #
Prerequisites #
If you haven't already, follow the initial steps of the Getting Started guide:
Installation and configuration #
Using the Command Line Interface #
-
Add the
dbt-postgrestransformer to your project usingmeltano add:meltano add transformer dbt-postgres -
Configure the settings below using
meltano config.
Next steps #
Follow the remaining steps of the Getting Started guide:
If you run into any issues, learn how to get help.
Settings #
Settings for dbt itself can be configured through dbt_project.yml as usual, which can be found at transform/dbt_project.yml in your Meltano project. dbt also has adapter-specific documentation for PostgreSQL.
These and other supported settings are documented below. To quickly find the setting you're looking for, use the Table of Contents at the top of the page.
Projects Directory (project_dir)
#
-
Environment variable:
DBT_POSTGRES_PROJECT_DIR - Default:
$MELTANO_PROJECT_ROOT/transform
How to use #
Manage this setting using
meltano config or an
environment variable:
meltano config dbt-postgres set project_dir <project_dir>
export DBT_POSTGRES_PROJECT_DIR=<project_dir>
Profiles Directory (profiles_dir)
#
-
Environment variable:
DBT_PROFILES_DIR, alias:DBT_POSTGRES_PROFILES_DIR - Default:
$MELTANO_PROJECT_ROOT/transform/profiles/postgres
How to use #
Manage this setting using
meltano config or an
environment variable:
meltano config dbt-postgres set profiles_dir <profiles_dir>
export DBT_PROFILES_DIR=<profiles_dir>
Host (host)
#
-
Environment variable:
DBT_POSTGRES_HOST
The postgres host to connect to.
How to use #
Manage this setting using
meltano config or an
environment variable:
meltano config dbt-postgres set host <host>
export DBT_POSTGRES_HOST=<host>
User (user)
#
-
Environment variable:
DBT_POSTGRES_USER
The user to connect as.
How to use #
Manage this setting using
meltano config or an
environment variable:
meltano config dbt-postgres set user <user>
export DBT_POSTGRES_USER=<user>
Password (password)
#
-
Environment variable:
DBT_POSTGRES_PASSWORD
The password to connect with.
How to use #
Manage this setting using
meltano config or an
environment variable:
meltano config dbt-postgres set password <password>
export DBT_POSTGRES_PASSWORD=<password>
Port (port)
#
-
Environment variable:
DBT_POSTGRES_PORT
The port to connect to.
How to use #
Manage this setting using
meltano config or an
environment variable:
meltano config dbt-postgres set port 1234
export DBT_POSTGRES_PORT=1234
Database (dbname)
#
-
Environment variable:
DBT_POSTGRES_DBNAME
The db to connect to.
How to use #
Manage this setting using
meltano config or an
environment variable:
meltano config dbt-postgres set dbname <dbname>
export DBT_POSTGRES_DBNAME=<dbname>
Schema (schema)
#
-
Environment variable:
DBT_POSTGRES_SCHEMA
The schema to use.
How to use #
Manage this setting using
meltano config or an
environment variable:
meltano config dbt-postgres set schema <schema>
export DBT_POSTGRES_SCHEMA=<schema>
Keep Alives Idle (keepalives_idle)
#
-
Environment variable:
DBT_POSTGRES_KEEPALIVES_IDLE
Seconds between TCP keepalive packets.
How to use #
Manage this setting using
meltano config or an
environment variable:
meltano config dbt-postgres set keepalives_idle 1234
export DBT_POSTGRES_KEEPALIVES_IDLE=1234
Search Path (search_path)
#
-
Environment variable:
DBT_POSTGRES_SEARCH_PATH
Overrides the default search path.
How to use #
Manage this setting using
meltano config or an
environment variable:
meltano config dbt-postgres set search_path <search_path>
export DBT_POSTGRES_SEARCH_PATH=<search_path>
Role (role)
#
-
Environment variable:
DBT_POSTGRES_ROLE
Role for dbt to assume when executing queries.
How to use #
Manage this setting using
meltano config or an
environment variable:
meltano config dbt-postgres set role <role>
export DBT_POSTGRES_ROLE=<role>
SSL Mode (sslmode)
#
-
Environment variable:
DBT_POSTGRES_SSLMODE
SSL Mode used to connect to the database.
How to use #
Manage this setting using
meltano config or an
environment variable:
meltano config dbt-postgres set sslmode '[...]'
export DBT_POSTGRES_SSLMODE='[...]'Looking for help? #
If you're having trouble getting the
dbt-postgres transformer to work, look for an
existing issue in its repository, file a new issue,
or
join the Meltano Slack community
and ask for help in the #plugins-general channel.
Found an issue on this page? #
This page is generated from a YAML file that you can contribute changes to. Edit it on GitHub!