KS DB Merge Tools logo KS DB Merge Tools
Documentation
KS DB Merge Tools for Cross-DBMS logo for Cross-DBMS
 
KS DB Merge Tools for Oracle logo
KS DB Merge Tools for MySQL logo
MssqlMerge logo
KS DB Merge Tools for PostgreSQL logo
KS DB Merge Tools for SQLite logo
AccdbMerge logo

Schema

Table definitions and views are by default identified by name. If both DBMS support schemas (i.e. Oracle, PostgreSQL, and SQL Server), the application can be configured to identify objects by the combination of schema and name. If this option is disabled (which is the default), and the same object name is used in different schemas, those objects remain unmatched and are counted as new. Name comparison is case-insensitive, so for example table myTable vs MyTable is considered the same table.

Additionally, the application supports advanced matching via Diff Profiles. You can define custom schema mappings (e.g., map hr_ prefix in SQLite to HumanResources schema in SQL Server) and name normalization rules (e.g., automatically match tblUserLocations and user_location by stripping prefixes/suffixes). These settings override the basic 'match by schema' option and enable reliable comparison across databases with different naming conventions.

All objects are built by reading object properties from different system metadata tables and views. Application reuses object reading logic from DBMS-specific products, so you can find more details about object definition reading in the 'How it works - Schema' section of documentation for corresponding tool:

Table Definitions

Each supported DBMS uses its own set of data types. KS DB Merge Tools for Cross-DBMS calls these data types native data types. Originally, to compare columns of different DBMS, KS DB Merge Tools for Cross-DBMS introduced the concept of generic data type: it is Number, String, Binary, Boolean, DateTime and Other. For example, a column of MySQL DECIMAL data type can be compared with a column of PostgreSQL smallint because both of these types are mapped to the Number generic data type. Other data types can not be compared with each other. See the Data types section to get more details about data type mapping.

Without Target schema, table definition is considered as changed if it has changed data columns (including order changes) or primary key columns. Data columns are identified by column name, generic type and nullability. Native types are shown for information only, native type changes do not affect identification of the table definition changes. Primary key columns are identified by column names and order.

Generic types allow a basic compare of any two DBMS, but they hide many details: for example, INT and BIGINT are both Number, and column defaults or CHECK constraints are not compared at all. Also, a generic type can't be converted back to a native type, so a table can't be created from it. In version 1.21.0 the Target schema was introduced: table definitions are converted into the target DBMS and compared there, including data types, expressions and constraints. See With Target Schema below.

Indexes

Indexes are identified by the combination of table, indexed columns and name of the index. If no match is found, then the application tries to find a matching index by the table and columns only (without index name). Index is counted as changed if it has changed Unique flag or index name. Index name is recognized as changed if index was matched by table and columns, without an index name.

Application does not show indexes supporting primary keys because the PRIMARY KEY definition is already included in the table definition. If DBMS makes no difference between constraint and index supporting such constraint, then such index may be excluded as well (for example, MySQL UNIQUE constraints/indexes). The reason is that such constraints are also going to be included in table definition.

Foreign Keys

Foreign keys are identified by the child table and its columns used for the foreign key definition. Foreign key is counted as changed if it has changed parent table, its columns, or on update/delete actions.

Views

Starting with version 1.7.0, the view is counted as changed if it has changed columns and/or their generic types, the same way as for table definitions. Before version 1.7.0 view was counted as changed if it has changed CREATE VIEW definition text. Obviously, this makes almost any view counted as the same to be considered as changed because of DBMS-specific syntax changes.

With Target Schema

In the Open databases dialog one of the databases can be marked as Target schema. It is required for the schema merge, and it also makes the table definition compare more detailed: the table definitions of the other (source) database are converted into the target DBMS, the same way as the schema merge creates them. Then they are compared with the target tables:

  • Data types: the data type of each source column is converted to a data type of the target DBMS, and it is compared with the target column type. For example, SQL Server INT and PostgreSQL bigint have the same generic type, but with PostgreSQL as Target schema the INT column is converted to integer, so the column is changed. The Table structure diff tab shows the converted type in the Type ({target DBMS}) column, and the Type status column shows if the data of these columns can be compared and merged, see How it works - Data.
  • Column default values and generated (computed) column expressions are converted to the target DBMS syntax and compared.
  • Constraints: PRIMARY KEY, UNIQUE and CHECK constraints are compared, with CHECK expressions converted to the target DBMS syntax. Constraint names are not compared.
  • The table text in the Text diff tab is a CREATE TABLE statement in the target DBMS syntax for both databases, in place of the pseudo-SQL with generic types.
  • If a data type or an expression can't be converted, Table structure diff lists it in the Conversion errors section, and the Object list shows the number of such errors in the Err column.
  • New tables can be merged into the target database from the Object list.

Indexes, foreign keys and views are compared the same way with or without Target schema.

What a Merge May Not Keep

To apply some changes, the application re-creates an object: it drops the object in the target database and creates it again. After that, some things that belonged to the object may no longer be there. This can include dependent objects and settings that are turned off in Settings, and features that the application does not support.

When a merge script re-creates objects, the application shows a warning in the Execute script dialog. If your database has something that the application does not read, please save it before the merge and add it back afterwards.


Last updated: 2026-11-18