PostgreSQL Migration Synchronization to Sybase
NineData Data Replication supports replicating data from PostgreSQL to Sybase, including full and incremental replication.
Feature Introduction
NineData data replication supports high-performance replication of structure, full data, and incremental data between data sources. For certain data sources, it also provides bidirectional replication, enabling the quick construction of geo-distributed active-active business architectures.
- Structure: Supports the replication of object structures between homogeneous and heterogeneous data sources, greatly reducing the barrier to data replication between two sources.
- Full Data: Achieves row-level concurrent batch replication through intelligent data sharding, effectively ensuring replication performance. The independently developed novel breakpoint resume technology ensures the accuracy of data in tables without primary keys.
- Incremental Data: Supports DML and DDL incremental data replication for all object types. By leveraging technologies such as row-level concurrency and hotspot merging, it delivers robust replication performance.
- Bidirectional Real-time Data Replication (only between MySQL instances): Direct bidirectional replication of data between multiple nodes ensures that all node data remains up-to-date.
With the above features, it is easy and efficient to achieve scenarios such as full|incremental data replication, full|incremental data migration, full|incremental data synchronization, data integration, and seamless migration without downtime, providing enterprises with flexible and reliable data replication solutions.
Prerequisites
Both the source and target data sources have been added to NineData. If you need to register PostgreSQL or Sybase data sources, see Creating a PostgreSQL Data Source and Creating 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 link 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
Usage Limitations
- This link does not support schema replication. Prepare the target database, tables, and required indexes in Sybase before you create the task.
- This link does not support column mapping. Target table names and column names must stay consistent with the source side.
- This link supports field expressions on existing target columns in
Configuration Mapping > Mapping and Filtering > Field Expression. See the recommended function list below. - This link 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 performing data synchronization, evaluate the performance of both the source and target data sources. It is recommended to run the task during off-peak business hours. Otherwise, full initialization can consume read/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.
Operation Steps
NineData’s data replication product has been commercialized. You can still use 10 replication tasks for free, with the following considerations:
Among the 10 replication tasks, you can include 1 Incremental task, with a specification of Micro.
Tasks with a status of Terminated do not count towards the 10-task limit. If you have already created 10 replication tasks and want to create more, you can terminate previous replication tasks and then create new ones.
When creating replication tasks, you can only select the Spec you have purchased. Specifications that have not been purchased will be grayed out and cannot be selected. If you need to purchase additional specifications, please contact us through the customer service icon at the bottom right of the page.
Log in to the NineData Console.
In the left navigation bar, click Replication.
On the Replication page, click Create Replication in the upper-right corner.
On the Source & Target tab, configure the task according to the table below, 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 link 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 link 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 upper-right corner to refresh the metadata.
On the Pre-check tab, wait for the precheck to complete. After the precheck passes, click Launch.
tip- You can enable Enable data consistency comparison. After synchronization completes, the system can automatically start a consistency comparison based on the source data source.
- 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.
Viewing Synchronization Results
Log in to the NineData Console.
Click on Replication > Data Replication in the left navigation bar.
On the Replication page, click the Task ID of the target synchronization task, and the page description is as follows.

No. Function Description 1 Synchronization Delay The data synchronization delay between the source and target data sources. 0 seconds indicate no delay between the two ends. At this point, you can choose to switch the business to the target data source to achieve a smooth migration. 2 Configure Alerts After configuring alerts, the system will notify you through your chosen method when the task fails. 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 not completed or in listening mode (i.e., incremental synchronization). After terminating the task, it cannot be restarted, please proceed with caution. If the synchronization object includes triggers, trigger replication options will pop up, please choose as needed.
- Delete: Delete the task, the task cannot be recovered after deletion, please proceed with caution.
4 Full Replication (displayed in scenarios including full replication) Display the progress and detailed information of full replication. - Click on Monitor on the right side of the page: View various monitoring metrics during the full replication process. During the full replication process, you can also click on Flow Control Settings on the right side of the monitoring metrics page to limit the rate of writing to the target data source per second. The unit is rows/second.
- Click on Log on the right side of the page: View the execution logs of full replication.
- Click on the
on the right side of the page: View the latest information.
5 Incremental Replication (displayed in scenarios including incremental replication) Display various monitoring metrics for incremental replication. - Click on View Threads on the right side of the page: 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 due to some reason.
- Event Time: The timestamp when the current thread started.
- Status: The status of the current thread.
- Click on Flow Control Settings on the right side of the page: Limit the rate of writing to the target data source per second. The unit is rows/second.
- Click on Log on the right side of the page: View the execution logs of incremental replication.
- Click on the
on the right side of the page: View the latest information.
6 Modify Objects Display the modification records of synchronization objects. - Click on Modify Objects on the right side of the page to configure synchronization objects.
- Click on the
on the right side of the page: View the latest information.
7 Data Comparison Display the results of the comparison between the source and target data sources. If you have not enabled data comparison, please click on Enable Comparison in the page. - Click on Re-compare on the right side of the page: Re-initiate a comparison between the current source and target data.
- Click on Stop on the right side of the page: After the comparison task starts, you can click this button to immediately stop the comparison task.
- Click on Log on the right side of the page: View the execution logs of consistency comparison.
- Click on Monitor on the right side of the page (only displayed during data comparison): View the trend chart of comparison RPS (records compared per second). Click on Details to view records from earlier times.
- Click on
in the Actions column on the right side of the comparison list (only displayed under the Data tab when inconsistencies are found): View the comparison details between the source and target ends.
- Click on
in the Actions column on the right side of the comparison list (displayed when inconsistencies are found): Generate change SQL, you can directly copy this SQL to the target data source for execution, modifying the inconsistent content.
8 Expand Display detailed information of the current replication task.
Appendix 1: Target Table Design Suggestions
Because PostgreSQL to Sybase replication does not currently support schema replication, it is recommended that you 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 | It is recommended to 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 really need to execute 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 Item List
| 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. |