dbeaver / dbeaver/dbeaver

Stale generated column

Open
#41,732 2 comments 0 reactions 0 assignees View on GitHub
wait for review xf:datatransfer xqa:need-testing
Dominant language
Java
Stars
51.8k
Forks
4.4k
Avg merge
3d 8h
Merged PRs (30d)
188

Description

### Description

After altering a generated column's expression with ALTER TABLE ... ALTER COLUMN ... SET EXPRESSION, and separately dropping and re-adding a CHECK constraint, DBeaver's Generate SQL → DDL export for that table produces output that does not match the database:

The generated column is exported with its previous expression. The new expression does not appear anywhere in the output.
The re-added CHECK constraint is exported as the literal text CONSTRAINT null, with no constraint body at all.

Both are silent. The exported file is syntactically valid and replays without error, producing a table that differs from the source database.

[DBeaver_BugReport_StaleGeneratedColumn_20260810.md](https://github.com/user-attachments/files/30909685/DBeaver_BugReport_StaleGeneratedColumn_20260810.md)

### DBeaver Version

Version 26.1.4.202608021747

### Operating System

Windows 11

### Database and driver

Postgres 17.6
postgresql-42.7.13.jar
Direct connection to Supabase

### Steps to reproduce

_No response_

### Additional context

_No response_

Contributor guide

Open the contributing guide

Research direction

Start with the attached DBeaver_BugReport_StaleGeneratedColumn_20260810.md and trace the Generate SQL → DDL export entry point for PostgreSQL tables. Reproduce the ALTER COLUMN ... SET EXPRESSION and CHECK constraint drop/re-add sequence against PostgreSQL 17.6, then inspect how the exporter obtains the generated expression and constraint body. Done means the exported DDL contains the current expression and complete CHECK constraint and recreates the source table faithfully.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, postgresql
Domain
databases
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Needs clarification
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.