Overview

Use PostgreSQL as a destination in Mage to export structured data from your pipelines directly into a PostgreSQL table. Mage supports both self-hosted and cloud-hosted PostgreSQL instances such as bit.io, Supabase, Render, and AWS RDS.

Mage will automatically create the target table and insert pipeline output rows into it, with support for schema selection, lowercase column naming, and reserved keyword handling.


Configuration Parameters

Provide the following credentials when setting up PostgreSQL as a destination:

KeyDescriptionExample ValueRequired
databaseName of the PostgreSQL database where data will be written.demo
hostHostname or IP address of the PostgreSQL server.db.bit.io
portPort used by the PostgreSQL service. Default is 5432.5432
usernameUsername with access to the target database and schema.guest
passwordPassword for the PostgreSQL user.abc123...
schemaName of the schema where the table will be created.public
tableName of the table Mage will write records into.dim_users_v1

Optional Parameters

KeyDescriptionExample Value
skip_schema_creationIf true, Mage will skip running CREATE SCHEMA. Use this if the schema already exists. See issuetrue
lower_caseIf true, Mage will convert all column names to lowercase. Default is true.true
allow_reserved_wordsIf true, Mage will allow column names that are PostgreSQL reserved words. Default is false.true or false

Notes

  • PostgreSQL is a widely supported open-source relational database—ideal for analytics, app backends, and transformations.
  • Ensure the user has CREATE TABLE, INSERT, and optionally CREATE SCHEMA privileges.
  • Mage supports exporting data to existing tables or creating new tables based on the pipeline output schema.
  • If your database is hosted on platforms like Heroku, AWS RDS, or bit.io, make sure the network settings allow inbound connections from Mage.