Inherited columns are not removed from a table's Columns tab after removing the parent table from "Inherited from"
Maintainer thường phản hồi trong vòng 1 ngày
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 84/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- javascript, postgresql, python
Hướng nghiên cứu
Bắt đầu với logic loại bỏ deferredDepChange của coll_inherits trong web/pgadmin/browser/server_groups/servers/databases/schemas/tables/static/js/table.ui.js và so sánh với get_formatted_columns trong web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/utils.py. Kiểm tra get_columns_for_table.sql và đường dẫn lấy thuộc tính để xác nhận rằng inheritedid được giữ lại sau khi mở lại. Hoàn tất nghĩa là việc xóa một parent đã lưu sẽ xóa các cột được kế thừa của nó mà không ảnh hưởng đến các cột riêng của child, với các bài kiểm thử liên quan đều đạt.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Describe the bug
When a parent table is added under "Inherited from" on a table's Columns tab, its columns are correctly pulled into the child's column list as read-only inherited columns. However, once the table has been saved and the Properties dialog reopened, removing that parent from "Inherited from" does not remove its columns from the Columns tab — they remain in the grid and are subsequently treated/saved as the child's own columns.
This is a separate, still-open issue from #10179 / #10332 — that fix addressed marking inherited columns read-only, not this removal path.
To Reproduce
- Open the Properties dialog of a table (or create a new one).
- On the Columns tab, add a parent table under "Inherited from".
- The parent's columns show up in the child's column list as inherited (read-only) columns.
- Save.
- Reopen the table's Properties dialog.
- Remove the parent table from "Inherited from".
- The previously-inherited columns stay in the Columns tab instead of being removed, and the list is what gets persisted on the next Save.
(Note: if the parent is added and removed within the same, unsaved dialog session, the columns are correctly removed — the bug only appears after a save + reopen cycle.)
Expected behavior
Removing a table from "Inherited from" should remove that parent's contributed columns from the child's Columns tab, leaving only the columns the child still legitimately owns — mirroring ALTER TABLE child NO INHERIT parent in PostgreSQL, and matching the "add" side of the same control.
Error message
N/A — no error is raised; this is a silent data/UI bug.
Screenshots
(attach if available)
Desktop (please complete the following information):
- OS: (fill in)
- pgAdmin version: 9.18-dev / master (
f09776c22or later, includes #10332) — (adjust to your actual build) - Mode: (Desktop or Server)
- Browser (if running in server mode): (fill in)
- Package type: (fill in)
Additional context
Root cause: table.ui.js's coll_inherits field's deferredDepChange "Remove columns logic" (around table.ui.js:685-706) removes stale columns by matching col.inheritedid == removeOid. That field is only present on columns fetched interactively via the get_columns endpoint (get_columns_for_table.sql, which returns both inheritedfrom and inheritedid).
Once the table is saved and reopened, its columns instead come from the properties fetch. get_formatted_columns (columns/utils.py, around L327-332) queries the same SQL for the parent's columns but only copies other_col['inheritedfrom'] into col['inheritedfromtable'] — it drops other_col['inheritedid'], even though it's available in the same row. So reopened columns carry no inheritedid, and the frontend's removal filter above can never match them — the parent's columns are stranded in the grid indefinitely.
Suggested fix: also stamp col['inheritedid'] = other_col['inheritedid'] in get_formatted_columns, so the existing frontend removal match works the same way whether a column was added interactively or loaded from a saved table's properties.
Verified against pgadmin-org/pgadmin4 master, commit f09776c22 (2026-09-15), which already includes the merged #10332 fix (153e3273d).
- Ngôn ngữ chính
- Python
- Star
- 3.9k
- Fork
- 904
- Merge trung bình
- 1 ngày 3 giờ
- Pull request đã merge (30 ngày)
- 30
Chuẩn bị môi trường
- Có Dockerfile hoặc tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của pgadmin-org/pgadmin4
-
Bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
pgadmin-org/pgadmin4#10503 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
pgadmin-org/pgadmin4#10462 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Feature
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
pgadmin-org/pgadmin4#10426 · 3 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
pgadmin-org/pgadmin4#10424 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
pgadmin-org/pgadmin4#10418 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của pgadmin-org/pgadmin4
Issue tương tự
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 92/100
-
Harmony OPeNDAP SubSetter (HOSS) Geographic LARC_CLOUD PREFIRE_SAT2_AUX-SAT R01 production
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
nasa/harmony-autotester#245 ·
-
[FEATURE] - Add UTVD supportĐang mởenhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
Deltares/imod-python#1928 ·
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 88/100
Maintainer thường phản hồi trong vòng 1 ngày
-
feature
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100