PostgreSQL Integration
Connect TDK to PostgreSQL databases for data masking, generation, and subsetting.
Overview
TDK supports:
-
PostgreSQL 11+
-
PostgreSQL 12, 13, 14, 15, 16
-
Amazon RDS for PostgreSQL
-
Amazon Aurora PostgreSQL
-
Azure Database for PostgreSQL
-
Google Cloud SQL for PostgreSQL
Connection Configuration
data_sources:
input:
url: jdbc:postgresql://localhost:5432/mydb
username: tdk_user
password: ${vault:secret/postgres#password}
driver_class_name: org.postgresql.Driver
Required Permissions
-- Read-only (recommended for source)
GRANT CONNECT ON DATABASE mydb TO tdk_user;
GRANT USAGE ON SCHEMA public TO tdk_user;
GRANT SELECT ON ALL TABLES IN SCHEMA public TO tdk_user;
-- Read-write (for target database)
GRANT ALL PRIVILEGES ON DATABASE mydb TO tdk_user;
GRANT ALL PRIVILEGES ON ALL TABLES IN SCHEMA public TO tdk_user;
GRANT ALL PRIVILEGES ON ALL SEQUENCES IN SCHEMA public TO tdk_user;
Performance Tips
-
Use connection pooling
-
Enable prepared statement caching
-
Consider partitioned tables for large datasets