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

Table Structure Diff Tab

  • Opened from: Object list, Data diff and Text diff tabs
  • Applicable tab-specific toolbar actions:
    • Jump to the last, next, previous, first change
    • Select all, none, invert selection on the left, all, none, invert selection on the right side
    • Merge left selected items to the right side, right selected items to the left side
    • Delete selected items on the right side, selected items on the right side
    • Export to Xlsx or Json
  • Applicable object types: Tables

This tab allows to compare definition of particular table:

for PostgreSQL, table structure diff tab annotated

Tab is divided into major collapsible sections (Columns, Constraints, Indexes, Triggers, Options and Partitions) and bottom panel for selected item details. Here is explanation of changes highlight annotation on the above screenshot:

  • 1 Changed item ("address" which has changed Nullability)
  • 2 New item ("last_update")
  • 3 Unchanged column with changed column order ("district")
  • 4 Changed column with changed column order ("address2" has changed varchar size, 50 vs 150)

Vertical toolbar between two panels contains additional tab-specific actions:

  • Open data diff for the current table
  • Open data diff for the current table filtered only to new and changed records
  • opens query result diff with select top 1000 records statement for this table
  • 'Open table definition as text' opens text diff tab with table script generated by application

Columns can be shown in the one of three modes:

  • Natural order - columns are shown in the order they were added to the database. Note that columns could be added in a different order like it is shown for column "district" on the picture above.
  • Sorted by name. In our example of "district" now this column will be shown side by side and without any highlighting as completely unchanged
  • Sorted Primary key columns followed by sorted all other columns. Similar to 'Sorted by name' but just primary key columns listed first.

Please note that merge/delete action may fail because of limitations caused by other objects such as foreign keys, existing data and so on. Please check the merge execution result for details.

Options

The Options section has 2 columns: Name and Value. It shows:

  • PARTITION BY - partition key of a partitioned table, for example RANGE (created). A partition key can not be added, changed or removed by ALTER TABLE, so this row can be merged only to a new table. If PARTITION BY is not selected for a new table, the table is created as a regular table, and the Execute script dialog shows a warning.
  • PARTITION OF - for a partition: parent table name and partition bound, for example public.orders FOR VALUES IN ('eu'). The button opens the table structure diff of the parent table. Merge attaches the table to the parent table (or changes the bound), Delete detaches it.
  • COMMENT - table comment. It is shown if at least one table has a comment, the other side has an empty value. Merge sets the comment with COMMENT ON TABLE, Delete removes it.

Comments

The Columns, Constraints, Indexes, Triggers and Partitions sections have the Comment column (before the Inherited column, if it is shown). When only a comment is changed, merge uses only COMMENT ON, the object is not re-created. When an object is re-created because of other changes, its comment is set again after the create. Comments are compared and merged only if the 'Compare comments' option is enabled in Settings, otherwise they are only shown.

Partitions

The Partitions section is shown for partitioned tables (see Partitioned Tables). Columns:

  • Name - partition name, with the schema name if it is not the schema of the parent table. The name is a link that opens the table structure diff of this partition
  • Bound - partition bound, for example FOR VALUES FROM ('2025-01-01') TO ('2026-01-01') or DEFAULT
  • Part. - number of partitions of a sub-partitioned partition, blank for other partitions
  • Status - ATTACHED, or NOT ATTACHED if a table with this name exists but is not a partition of this parent table
  • Comment - table comment of the partition
  • Data - the same data diff buttons as in the Object list

Merge of a Partitions row creates the partition, attaches a NOT ATTACHED table, detaches a table that is NOT ATTACHED on the source side, changes the bound, or merges changes of the partition's own objects. Delete of a Partitions row drops the partition table with its data. Merge does not drop partitions that exist only on the target side, use Delete for that.

A partition is opened in this tab as a table. It has the PARTITION OF row in the Options section, and the Constraints, Indexes and Triggers sections have the Inherited column: Yes for objects that PostgreSQL copies from the parent table. Inherited objects are shown with the names of the parent table objects, and merge skips them. Columns of a partition come from the parent table, they can not be added or deleted here.

Some changes can not be done without a drop of the target table. Then the merge is disabled and the toolbar button tooltip has the reason.


Last updated: 2026-10-23