GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Issue with CREATE script: Schema Diff generates wrong SQL for SERIAL columns after renaming, or when a sequence name accidentally matches · Issue #10100 · pgadmin-org/pgadmin4

Issue with CREATE script: Schema Diff generates wrong SQL for SERIAL columns after renaming, or when a sequence name accidentally matches #10100

New issue
Copy link
New issue
Copy link
Closed
#10167
Closed
Issue with CREATE script: Schema Diff generates wrong SQL for SERIAL columns after renaming, or when a sequence name accidentally matches#10100
#10167
Copy link
Labels
Bug
Milestone
9.17

Description

@hiteshjambhale
hiteshjambhale
opened on Jun 16, 2026
Issue body actions

What's going wrong

PR #10020 fixed Schema Diff's Generate Script so it emits SERIAL instead
of the raw nextval(...) form. The fix works by guessing the sequence name
from the table and column name (e.g. table orders, column id → looks for
orders_id_seq)

  1. If you rename a table or column after creating it, the sequence keeps its
    old name but the guess uses the new name — so they don't match anymore.

How to reproduce:

CREATE TABLE orders (id serial PRIMARY KEY);
ALTER TABLE orders RENAME TO invoices;
Now run Schema Diff → Generate Script on the invoices table.

What you get (wrong):


id integer NOT NULL DEFAULT nextval('orders_id_seq'::regclass)

What you should get:

id serial NOT NULL
If you run the wrong script on a fresh database it fails with:


ERROR: relation "orders_id_seq" does not exist
— the same error the original bug report described.

Activity

  1. hiteshjambhale
    added
    Bug
    on Jun 16, 2026
  2. kundansable
    added a commit that references this issue on Jul 22, 2026

    fix: use pg_depend ownership instead of name guessing for SERIAL dete…

    This issue will close once commit da9395c is merged into the 'master' branch.
    da9395c
  3. asheshv
    closed this as completedin #10167on Jul 24, 2026
  4. asheshv
    added a commit that references this issue on Jul 24, 2026

    fix: use pg_depend ownership instead of name guessing for SERIAL dete…

    b85fb6c
  5. asheshv
    added this to the 9.17 milestone on Jul 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Bug

    Type

    No type

    Projects

    No projects

      Milestone

      • 9.17

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402775 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.