pgadmin-org / pgadmin-org/pgadmin4

Diff - identity Columns & Comments

Open
#10,422 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Bug
Dominant language
Python
Stars
3.8k
Forks
891
Avg merge
4d 7h
Merged PRs (30d)
8

Description

Please note that security bugs or issues should be reported to security@pgadmin.org.

Describe the bug

Whenever I do a diff between two schemas that should be identical, the process finds that the identity column definitions are sometimes different . It would be nice to be able to ignore the settings like the START value.
However, whenever there is a difference in the identity definition, the associated column comment is dragged into the mix as being different too.

Here are the definitions on the source:
status_entry_id integer NOT NULL GENERATED ALWAYS AS IDENTITY (INCREMENT 1 START 0 MINVALUE 0 MAXVALUE 2147483647 CACHE 3)
COMMENT ON COLUMN survey.application_status.status_entry_id IS 'A value to ensure that the primary key has a unique value.';

Here are the definitions on the target:
status_entry_id integer NOT NULL GENERATED ALWAYS AS IDENTITY (INCREMENT 1 START 7482970 MINVALUE 0 MAXVALUE 2147483647 CACHE 3)
COMMENT ON COLUMN survey.application_status.status_entry_id IS 'A value to ensure that the primary key has a unique value.';

The comment ddl is exactly the same between source and target, but because the START value between source and target is different, both the column and the column comment are flagged as being different.

To Reproduce

Steps to reproduce the behavior:

  1. create a table with an identity column in two different databases
  2. Add identical column comments to the identity column in both databases
  3. Change the start value of the identity in the target table
  4. Run a diff on the table
  5. You will see that the comment definition is flagged as being different between the 2 tables.

Expected behavior

A clear and concise description of what you expected to happen.

Error message

If possible, include the full, unedited text of any error messages displayed.

Screenshots

If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: Windows 11
  • pgAdmin version: 9.1.7
  • Mode: Desktop
  • Package type: [e.g. RPM, DEB, Python, Container, etc.]

Additional context

Add any other context about the problem here.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the schema diff with identical column comments and different identity START values in two PostgreSQL databases, as described in the issue. Trace the pgAdmin schema-diff handling for identity definitions and column comments. Done means the differing identity setting can be reported without incorrectly flagging the identical column comment.

Written by the indexing model from the issue text.

Assessment

Tech stack
postgresql, python
Domain
databases
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
65/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.