PostgreSQL Target Configuration
Use this page when PostgreSQL is the target for a DBConvert Streams workflow.
PostgreSQL targets receive data from both Load and CDC streams. The source can be MySQL, PostgreSQL, local files, or S3-compatible storage.
Target privileges
The target user needs write access to the target database and schema. The exact privileges depend on the stream configuration:
| Privilege | When needed |
|---|---|
INSERT on tables | Always — all streams write rows |
CREATE on schema | When structure options allow table/index creation |
USAGE on schema | Always — required to access schema objects |
TRUNCATE on tables | When writeMode is truncate_and_load |
Example grants for a target user that can create and write:
GRANT USAGE, CREATE ON SCHEMA public TO target_user;
GRANT INSERT, UPDATE, TRUNCATE ON ALL TABLES IN SCHEMA public TO target_user;
ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT INSERT, UPDATE, TRUNCATE ON TABLES TO target_user;
For drop_and_recreate schema policy, the user also needs ownership of the tables or superuser access, since PostgreSQL uses DROP TABLE ... CASCADE.
For connection and network setup, see PostgreSQL Server Configuration. To verify visible schemas and tables, open the connection in Data Explorer.
Target behavior
Two settings control what the stream does with existing target tables and data:
| Setting | What it controls | Default (Load) | Default (CDC) |
|---|---|---|---|
schemaPolicy | What to do if target tables already exist | fail_if_exists | validate_existing |
writeMode | What to do if target tables contain rows | fail_if_not_empty | upsert |
CDC mode supports upsert (default, recommended) and append. Use append for insert-only workloads where you want maximum write throughput. See Target Schema and Data Policies for all values and decision guidance.
Structure creation
By default, the stream creates missing tables, indexes, foreign keys, and check constraints on the target. Disable any of these with structure options.
When the source is MySQL, data types are converted automatically. See Table Structure Conversion for the full mapping.
Validation checklist
- Test the target connection from the Data Explorer sidebar (right-click → Test connection) or from the connection editor.
- Open the target database in Data Explorer and confirm the expected database and schemas are reachable.
- Verify the target user has the required privileges for your chosen schema policy and write mode.
- Run a small validation stream (one or two tables) before scaling up.