Overview
Wirekite supports PostgreSQL 10 and above (including YugaByte, TigerData, Google AlloyDB, and AWS Aurora PostgreSQL) as a target database for:- Schema Loading - Create target tables from Wirekite’s intermediate schema format
- Data Loading - Bulk load extracted data using COPY command
- Change Loading (CDC) - Apply ongoing changes using merge table approach
PostgreSQL loaders use the high-performance COPY command for bulk loading. The Change Loader uses shadow tables with
_wkm suffix for atomic change application.Prerequisites
Before configuring PostgreSQL as a Wirekite target, ensure the following requirements are met:Database Configuration
- Version: PostgreSQL 10 or above
- User Permissions: Create a Wirekite user with:
- CREATE TABLE privilege
- FILE access for COPY operations
- INSERT, UPDATE, DELETE on target tables
- Read/write access to Wirekite internal tables (
wirekite_progressandwirekite_action)
CLI Tools
Use thepsql command line tool or Wirekite cmdline tool to interact with PostgreSQL.
Schema Loader
The Schema Loader reads Wirekite’s intermediate schema format (.skt file) and generates PostgreSQL-appropriate DDL statements for creating target tables.
If you need to add storage directives or other schema elements, use the CREATE TABLE output as a basis. Don’t change column names, column order, or datatypes to incompatible ones.
Required Parameters
Path to the Wirekite schema file (
.skt) generated by the Schema Extractor. Must be an absolute path.Output file for CREATE TABLE statements. Includes both base tables and merge tables for CDC operations.
Output file for non-columnar constraints including indexes. Column-level constraints (NOT NULL) are in CREATE TABLE.
Output file for FOREIGN KEY definitions. Consider applying these after initial data load for better performance.
Absolute path to the log file for Schema Loader operations.
Optional Parameters
Output file for DROP TABLE IF EXISTS statements. Set to “none” to skip generation.
Output file for recovery table creation SQL. Set to “none” to skip.
When
true, generates merge tables for CDC operations. Set to false if only doing data loads.Extended Schema Options
When migrating from Oracle, PostgreSQL can generate additional DDL for non-table objects. Set each parameter to a file path to enable, or leave as"none" to skip.
Path to the source XKT file containing extended schema objects (views, procedures, etc.).
Output file for CREATE INDEX statements.
Output file for CREATE SEQUENCE statements.
Output file for CREATE VIEW statements.
Output file for CREATE MATERIALIZED VIEW statements.
Output file for CREATE SYNONYM statements.
Output file for GRANT statements.
Output file for role and user creation statements.
Output file for CREATE SCHEMA statements.
Output file for CREATE TRIGGER statements.
Output file for CREATE PROCEDURE statements.
Output file for CREATE FUNCTION statements.
Output file for CREATE PACKAGE statements.
Data Loader
The Data Loader reads Wirekite’s intermediate data format (.dkt files) and loads records into PostgreSQL tables using COPY commands.
Required Parameters
Path to a file containing the PostgreSQL connection string.
Directory containing data files (
.dkt) to load.Path to the Wirekite schema file used by Schema Loader. Required for table structure information.
Absolute path to the log file for Data Loader operations.
Optional Parameters
Maximum number of parallel threads for loading tables. We recommend setting this to the number of CPUs on the host.
Set to
true if data was extracted using hex encoding instead of base64.When
true, uses COPY FROM STDIN. When false, uses local file I/O methods.When
true, removes data files from inputDirectory after loading. Should typically be true to save disk space.Change Loader
The Change Loader applies ongoing data changes (INSERT, UPDATE, DELETE) to PostgreSQL tables using a merge approach with shadow tables.The Change Loader uses merge tables to stage changes before applying them atomically to base tables.
Required Parameters
Path to a file containing the PostgreSQL connection string.
Directory containing change files (
.ckt) from the Change Extractor.Working directory for intermediate files during merge operations.
Path to the Wirekite schema file for table structure information.
Absolute path to the log file for Change Loader operations.
Optional Parameters
When
true, indicates remote database connection mode.Maximum number of change files to process in a single batch.
When
true, removes change files from inputDirectory after fully processing. Should typically be true to save disk space.Orchestrator Configuration
When using the Wirekite Orchestrator, prefix target parameters withtarget.schema., target.data., or target.change..
Example orchestrator configuration for PostgreSQL target:
