PostgreSQL to Sybase Data Replication
NineData Data Replication supports replicating data from PostgreSQL to Sybase, including full and incremental replication.
Overview
NineData data replication supports schema, full data, and incremental data replication between data sources. For supported data sources, it also supports bidirectional replication for geo-distributed active-active architectures.
- Schema replication: Replicates object structures between homogeneous and heterogeneous data sources.
- Full data replication: Uses data sharding and row-level concurrent batch replication to improve throughput. Breakpoint resume helps preserve data accuracy, including for tables without primary keys.
- Incremental data replication: Replicates DML and DDL changes for supported object types. Row-level concurrency and hotspot merge processing help maintain replication throughput.
- Bidirectional real-time data replication (only between MySQL instances): Replicates changes in both directions between nodes so data can stay current across participating nodes.
Use these capabilities for full or incremental data replication, migration, synchronization, data integration, and low-downtime migration workflows.
Before you begin
Add the source and target data sources to NineData. For instructions, see Create a PostgreSQL data source and Create a Sybase data source.
The source data source is PostgreSQL.
The target data source is Sybase.
Tables must already be created manually in the target data source (Sybase), and their structure must be compatible with the source tables in PostgreSQL. This replication path does not support schema replication. See Appendix 1: Target Table Design Suggestions.
You must have the appropriate permissions on both the source and target data sources. For more detailed guidance, trigger behavior, and grant examples, see PostgreSQL and Sybase Replication Permission Guide.
Replication Content PostgreSQL Sybase Full Replication CONNECT, SELECT SELECT, INSERT, UPDATE, DELETE on the target tables Incremental Replication Permissions required to read source-side changes, plus the PostgreSQL parameter configuration described below SELECT, INSERT, UPDATE, DELETE on the target tables; if target triggers stay disabled during replication, replication_roleis also requiredFor incremental replication, open
postgresql.confand configure the following parameters. If you cannot find the file location, runSHOW config_file;in a psql client.- The
wal_levelparameter of the source data source must belogical. To confirm the current value, runSHOW wal_level. - The
wal_sender_timeoutparameter of the source data source must be set to0. This parameter interrupts replication connections that remain stalled longer than the specified number of milliseconds. The default is 60000 milliseconds. Setting it to0disables the timeout. To confirm the current value, runSHOW wal_sender_timeout. - The
max_replication_slotsparameter of the source data source must be greater than1. This parameter specifies the maximum number of replication slots the server supports. The default value is10. - The
max_wal_sendersparameter of the source data source must be greater than1. This parameter specifies the maximum number of concurrent replication connections. The default value is10. To confirm the current value, runSHOW max_wal_senders.
- The
Restrictions
- This replication path does not support schema replication. Prepare the target database, tables, and required indexes in Sybase before you create the task.
- This replication path does not support column mapping. Target table names and column names must stay consistent with the source side.
- This replication path supports field expressions on existing target columns in
Configuration Mapping > Mapping and Filtering > Field Expression. See the recommended function list below. - This replication path does not support incremental DDL replication. During incremental replication, only data changes are synchronized. If the source adds columns or changes data types, handle those structural changes manually before continuing.
- Before you run a replication task, evaluate the performance of both the source and target data sources. Run the task during off-peak hours when possible because full initialization can consume read and write resources and increase database load.
- Ensure that each replicated table has a primary key or unique constraint, and that column names are unique. Otherwise, duplicate synchronization may occur.
Field Mapping and Field Expressions
- Target fields must remain consistent with actual columns in the Sybase target table.
- In
Configuration Mapping > Mapping and Filtering > Field Expression, you can configure field expressions for existing target columns.
For the entry, usage rules, and common writing patterns of field expressions, see ETL Functions.
Procedure
Log in to the NineData Console.
From the navigation menu, click Replication.
On the Replication page, click Create Replication in the page header.
On the Source & Target tab, configure the task using this table, then click Next.
Parameter Description Name Enter a meaningful task name. Up to 64 characters are supported. Source Select the PostgreSQL source data source. Target Select the Sybase target data source. Target DB Select the target database that will receive the synchronized objects. Type Select Full for full replication. If you need continuous synchronization of source-side changes, also enable Incremental. Target Table Exists Data Choose how to handle data that already exists in the target tables: stop, ignore conflicting rows, or delete and rewrite them. Trigger Choose whether to execute target-side Sybase triggers during replication. The default is disabled. If you keep the default, the target account needs replication_role. If you enable target triggers, writes may fail because of foreign keys, audit logic, or business-trigger behavior.On the Objects tab, choose the objects to replicate, then click Next.
- You can choose All Objects to replicate all source objects, or choose Customized Object to replicate only selected objects.
- This replication path does not support column mapping, so target table names and column names must stay consistent with the source side.
On the Mapping tab, confirm the target database and target table mapping, then click Save and Pre-Check.
- The system prefers the database with the same name on the target side. If no same-name database exists, select the target database manually.
- This replication path does not support schema replication. Confirm that target tables, columns, primary keys, and required indexes already exist.
- If metadata changes on the source or target side during configuration, click Refresh Metadata in the page header to refresh the metadata.
On the Pre-check tab, wait for the precheck to complete. After the precheck passes, click Launch.
tip- Enable Enable data consistency comparison to start a consistency comparison based on the source data source after synchronization completes.
- If the precheck fails, click Details in the Actions column for the failed item, fix the problem manually, then click Check Again until the precheck passes.
- If an item shows Result as Warning, you can decide whether to fix or ignore it based on your scenario.
After the Launch page shows Launch Successfully, the replication task starts running. At this point, you can click View Details to view details or click Back to list to return to the task list.
Result
Log in to the NineData Console.
In the navigation menu, click Replication > Data Replication.
On the Replication page, click the Task ID of the target synchronization task, and review the task details page.

No. Function Description 1 Synchronization Delay The synchronization delay between the source and target data sources. 0seconds means the target has caught up with the source, so you can switch traffic based on your migration plan.2 Configure Alerts When the task fails, the system notifies the selected channel through the configured alert. 3 More - Pause: Pause the task, only available for tasks in the running status.
- Duplicate: Create a new replication task with the same configuration as the current task.
- Terminate: End tasks that are incomplete or in listening mode (i.e., incremental synchronization). After terminating the task, it cannot be restarted, proceed with caution. If the synchronization object includes triggers, trigger replication options appear for selection.
- Delete: Delete the task, the task cannot be recovered after deletion, proceed with caution.
4 Full Replication (displayed in scenarios including full replication) Displays the progress and detailed information of full replication. - Click Monitor to view various monitoring metrics during the full replication process. During the full replication process, you can also click Flow Control Settings on the monitoring page to limit the rate of writing to the target data source per second. The unit is rows/second.
- Click Log to view the execution logs of full replication.
- Click the
to view the latest information.
5 Incremental Replication (displayed in scenarios including incremental replication) Displays various monitoring metrics for incremental replication. - Click View Threads to view the operations currently being executed by the replication task, including:
- Thread ID: The replication task is executed by multiple threads, displaying the current thread number.
- Execute SQL: Details of the SQL statement currently being executed by the current thread.
- Response Time: The response time of the current thread, if this value increases, it indicates that the current thread may be stuck for some reason.
- Event Time: The timestamp when the current thread started.
- Status: The status of the current thread.
- Click Flow Control Settings to limit the rate of writing to the target data source per second. The unit is rows/second.
- Click Log to view the execution logs of incremental replication.
- Click the
to view the latest information.
6 Modify Objects Displays the modification records of synchronization objects. - Click Modify Objects to configure synchronization objects.
- Click the
to view the latest information.
7 Data Comparison Displays the results of the comparison between the source and target data sources. If data comparison is not enabled, click Enable Comparison on the page to enable it. - Click Re-compare to rerun the comparison for the current source and target data sources.
- Click Stop: After the comparison task starts, you can click this button to immediately stop the comparison task.
- Click Log to view the execution logs of consistency comparison.
- Click Monitor (only displayed during data comparison) to view the trend chart of comparison RPS (records compared per second). Click Details to view records from earlier times.
- Click the
in the Actions column in the comparison list (only displayed under the Data tab when inconsistencies are found) to view the comparison details between the source and target data sources.
- Click the
in the Actions column in the comparison list (displayed when inconsistencies are found): Generate change SQL. You can copy this SQL to the target data source and run it to fix the mismatch.
8 Expand Displays detailed information of the current replication task.
Appendix 1: Target Table Design Suggestions
Because PostgreSQL to Sybase replication does not currently support schema replication, create the target tables in Sybase manually before you create the task.
Common Data Type Mapping
| PostgreSQL Data Type | Recommended Sybase Type | Notes |
|---|---|---|
SMALLINT | SMALLINT | Direct mapping is usually fine. |
INTEGER / INT4 | INT | Direct mapping is usually fine. |
BIGINT / INT8 | BIGINT | Direct mapping is usually fine. |
NUMERIC(p,s) / DECIMAL(p,s) | DECIMAL(p,s) | Keep precision and scale aligned whenever possible. |
REAL | REAL | Direct mapping is usually fine. |
DOUBLE PRECISION | DOUBLE PRECISION | Adjust based on precision requirements if needed. |
BOOLEAN | BIT | Standardize the business meaning around 0 / 1. |
CHAR(n) / VARCHAR(n) | CHAR(n) / VARCHAR(n) | Length definitions can usually be preserved. |
TEXT | TEXT / UNITEXT | UNITEXT is often a good choice for large text content. |
BYTEA | VARBINARY / IMAGE | Evaluate whether large binary objects should use IMAGE. |
DATE | DATE | Direct mapping is usually fine. |
TIMESTAMP | DATETIME / BIGDATETIME | If you need higher timestamp precision, prefer BIGDATETIME. |
TIME | TIME / BIGTIME | Choose based on precision requirements. |
UUID | CHAR(36) / VARCHAR(36) | It is generally safest to store UUID values as strings. |
JSON / JSONB | UNITEXT / VARCHAR | Store JSON content as string/text data. |
Table Design Suggestions
- Keep target table names and column names consistent with the source side whenever possible, because this link does not support column mapping.
- Create primary keys, unique constraints, and required indexes in advance so that incremental writes and data comparison stay stable.
- If target tables contain triggers, confirm whether they should run during replication. Keeping them disabled is usually the safer default.
- If the target tables contain identity columns, auto-increment logic, or audit columns, validate both full initialization and incremental replay in a test environment first.
Appendix 2: Precheck items
| Check Item | Description |
|---|---|
| Target object existence check | Check whether the objects to be replicated already exist in the target database. |
| Source data source connection check | Check gateway status, connectivity, and account credentials for the source data source. |
| Target data source connection check | Check gateway status, connectivity, and account credentials for the target data source. |
| Target privilege check | Check whether the target account has sufficient permissions. |
| Source privilege check | Check whether the source account has sufficient permissions. |
| Target data existence check | Check whether target objects already contain data. |
Check wal_level | Check whether the source wal_level is logical. |
Check max_wal_senders | Check whether max_wal_senders satisfies replication connection requirements. |
Check max_replication_slots | Check whether max_replication_slots satisfies replication-slot requirements. |