target-postgres is a loader that moves data into a PostgreSQL (same as Postgres) database. In order to use this target, you will need a Postgres database where Meltano can load data.
In this section, we provide a tutorial for installing Postgres and setting up a new Postgres database.
createuser -s postgres- this fixes the error: role "postgres" does not exist
ALTER USER postgres WITH PASSWORD 'password';with the new password of your choice
\duto get a list of users (from within psql)
psql -U postgres(by default, Postgres will log you into your username account on your machine so you will need to switch to the new user we created in the steps above)
Once you have identified a PostgreSQL database where Meltano should load the data it extracts from your source(s), add the
target-postgres loader to Meltano:
cd my_project meltano add loader target-postgres
You can now configure target-postgres to use your PostgreSQL database
In this section we provide additional information for configuring Meltano to connect with your PostgreSQL database from the Meltano command line interface (CLI).
.envfile in your project directory if it doesn't exist already
.envfile in a text editor
export PG_ADDRESS="" export PG_USERNAME="" export PG_PORT="" export PG_PASSWORD="" export PG_DATABASE="" # export PG_URL="" # alternatively specify a postgresql:// connection URL # export PG_SCHEMA="" # override if the default (see below) is not appropriate
Enter the appropriate values for each variable inside the quotes.
The default value for
$MELTANO_EXTRACTOR_NAMESPACE, which will expand to the
namespace of the
extractor used in the pipeline, e.g.
If you are running Meltano UI (
meltano ui), you will need to restart it for the changes to take effect.