Compatible versions
PostgreSQL 12 still works but has reached end of life upstream and is no longer covered.
Prerequisites
- Roles and permissions: a PostgreSQL role with
CREATE,INSERT,UPDATE,DELETE, andALTERrights on the target schema, plus permission to execute functions required forCOPYorINSERToperations. - Infrastructure settings: outbound network access from Popsink to port 5432 (or your custom port) with TLS enabled and root certificates imported. See Compatible versions for the supported PostgreSQL releases.
- Quotas and limits: provision disk capacity for at least 150% of the expected daily volume and verify concurrent connection limits (
max_connections) to accommodate Popsink workers. - Monitoring and audits: enable
pg_stat_statementsand error logging to trace connector activity.
Configuration
- Batch ingestion
- Streaming ingestion
1
Declare the destination
Provide the host, port, database, and target schema in Popsink. Attach a secret containing the user, password, and SSL string (
sslmode=require) if needed.2
Configure the write mode
Choose
COPY for large volumes or INSERT for smaller datasets. Configure the maximum batch size (batch_size) and duplicate key handling (upsert_strategy).3
Schedule loads
Define the sync cadence and retention rules for intermediate files. Ensure maintenance windows do not overlap with scheduled batches.
Data types
Popsink creates each table on its first record. Columns are typed from the Avro schema of the source record, read from the Schema Registry, never from the values. When a subscription applies its column mapping, an explicit cast in the mapping takes precedence. An existing table keeps the types it already has.
A cast in the column mapping produces:
int / long → bigint, float / double → double precision, bool → boolean, date → date, datetime → timestamp, time → time, decimal → numeric(p,s) from its format (numeric(38,9) when none is given), any other cast → text.
Schema evolution
- New source columns are added with
ALTER TABLE … ADD. - Type changes are applied with
ALTER COLUMN … TYPEwhen the new type is wider. Decimals are widened, never narrowed. If PostgreSQL refuses the change, the subscription stops on that table instead of skipping data. - Dropped source columns are kept in the table, and stay
NULLfor new rows. - With schema evolution off on the subscription, any change that needs an
ALTERstops the subscription.
Monitoring
- Instrument a dashboard built on
pg_stat_activity, lock durations (pg_locks), and Popsink metrics (throughput, latency, errors). - Enable job failure notifications in Popsink and forward PostgreSQL logs to your SIEM.
- Configure disk quotas and WAL usage alerts to prevent replication stoppages.
Best practices
- Normalize data types (UUID, JSONB, timestamp with time zone) to avoid expensive conversions.
- Document target tables with SQL comments to streamline maintenance.
- Orchestrate schema changes outside of loading windows.
Avoid setting
synchronous_commit=off on the Popsink session: if a failure occurs, you may lose transactions that were confirmed on the source.FAQ
What if a batch fails because of a unique constraint?
What if a batch fails because of a unique constraint?
Enable
upsert mode with ON CONFLICT DO UPDATE and use a versioning column (updated_at) to resolve collisions.How do I handle partitioned tables?
How do I handle partitioned tables?
Declare the parent table in Popsink and ensure the PostgreSQL partitioning strategy routes rows automatically via triggers or
PARTITION BY.Which logs should I review first?
Which logs should I review first?
Start with Popsink logs to identify the failing step, then correlate with
postgresql.log and pg_stat_activity for SQL details.Monitor targets
Understand metrics shared across all target connectors.
Alerting Popsink
Configure notifications and webhooks when incidents occur.
Start a pipeline
End-to-end example to validate your Postgres configuration.