You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the Create/Properties dialog for a table that inherits from one or more parent tables, inherited columns are not handled correctly in the Columns grid:
On opening an inheriting table, the inherited columns are shown as fully editable — their Name / Data type cells and the row edit/delete buttons are enabled — instead of read-only.
When a parent is added interactively via "Inherited from table(s)", the fetched columns are added to the grid but are also fully editable (not marked inherited).
When a parent is removed, its columns are (in the fixed SQL case) dropped, but the remaining local columns' edit/delete buttons incorrectly become disabled.
Root causes (all in the shared SchemaView / table dialog code, so this is upstream pgAdmin, not distro-specific):
The column properties query hardcodes the child table OID in the pg_inherits join, so inheritedfrom/inheritedid are never populated: web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/columns/sql/default/properties.sql:8 → ... AND ph.inhrelid = 33896::oid (should use the {{tid}} parameter already used on the same template's WHERE att.attrelid = {{tid}}::oid). This is the default template (no version-specific override for columns), so it affects all supported PostgreSQL versions, not just PG 14+.
Interactively adding a parent fetches its columns via the columns endpoint (which returns them as local, since the parent doesn't itself inherit) and never stamps inheritedfrom/inheritedid on them.
The column's cell-editability check (inSchemaWithColumnCheck) returns "editable" for any new row before it checks inheritedfrom, so interactively-added inherited columns stay editable.
The row edit/delete cells read their options without subscribing to option changes, so after the columns array is modified and rows shift index, they keep a stale enabled/disabled state.
To Reproduce
Steps to reproduce the behavior:
In the Query Tool, create an inheritance hierarchy:
Observe the inherited columns a_id, a_name — they are editable (Name/Data type not greyed, edit/delete enabled).
Add another table (e.g. pg_amproc) in Inherited from table(s) → its columns appear but are also editable.
Remove parent_a from Inherited from table(s) → the local column own_col's edit/delete buttons become disabled.
Expected behavior
Inherited columns (from any parent, whether present on open or added interactively) are shown read-only: Name / Data type cells greyed and the row edit/delete buttons disabled.
Local columns (e.g. own_col) remain fully editable/deletable, including after a parent is de-selected.
De-selecting a parent removes only that parent's inherited columns; local columns remain.
inheritedfrom and inheritedid are populated for inherited columns in the column properties response.
Error message
No error is thrown — this is a silent UI/logic issue. The underlying cause is visible in the column properties SQL: the INH_TABLES CTE joins pg_inherits on a hardcoded OID (33896) instead of {{tid}}, so every column returns inheritedfrom = NULL / inheritedid = NULL.
Screenshots
Compare the Columns tab of an inheriting table: inherited columns' Name/Data type should be greyed and edit/delete disabled (like other tools), but currently render editable. (Attach a before/after of the Columns grid showing inherited columns editable vs. correctly disabled.)
Desktop
OS: macOS
pgAdmin version: 9.16
Mode: Server
Browser (if running in server mode): Chrome
Package type: Python (running from source)
Additional context
The hardcoded OID was introduced in commit 7b9b8cdd0 ("Rebase the version-specific SQL templates to target PostgreSQL 14 (Rebase the version-specific SQL templates to target PostgreSQL 14 #10054)"), so the read-only regression is recent; the interactive add/remove gaps are longer-standing.
Affected areas: tables/templates/columns/sql/default/properties.sql, tables/columns/static/js/column.ui.js (inSchemaWithColumnCheck), tables/static/js/table.ui.js (inherit add/remove), and the shared SchemaView/DataGridView edit/delete cells (deletable.js, expandabledFormView.jsx) which read row options without subscribing.
Describe the bug
In the Create/Properties dialog for a table that inherits from one or more parent tables, inherited columns are not handled correctly in the Columns grid:
Root causes (all in the shared SchemaView / table dialog code, so this is upstream pgAdmin, not distro-specific):
pg_inheritsjoin, soinheritedfrom/inheritedidare never populated:web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/columns/sql/default/properties.sql:8→... AND ph.inhrelid = 33896::oid(should use the{{tid}}parameter already used on the same template'sWHERE att.attrelid = {{tid}}::oid). This is thedefaulttemplate (no version-specific override for columns), so it affects all supported PostgreSQL versions, not just PG 14+.inheritedfrom/inheritedidon them.inSchemaWithColumnCheck) returns "editable" for any new row before it checksinheritedfrom, so interactively-added inherited columns stay editable.To Reproduce
Steps to reproduce the behavior:
a_id,a_name— they are editable (Name/Data type not greyed, edit/delete enabled).pg_amproc) in Inherited from table(s) → its columns appear but are also editable.parent_afrom Inherited from table(s) → the local columnown_col's edit/delete buttons become disabled.Expected behavior
own_col) remain fully editable/deletable, including after a parent is de-selected.inheritedfromandinheritedidare populated for inherited columns in the column properties response.Error message
No error is thrown — this is a silent UI/logic issue. The underlying cause is visible in the column properties SQL: the
INH_TABLESCTE joinspg_inheritson a hardcoded OID (33896) instead of{{tid}}, so every column returnsinheritedfrom = NULL/inheritedid = NULL.Screenshots
Compare the Columns tab of an inheriting table: inherited columns' Name/Data type should be greyed and edit/delete disabled (like other tools), but currently render editable. (Attach a before/after of the Columns grid showing inherited columns editable vs. correctly disabled.)
Desktop
Additional context
7b9b8cdd0("Rebase the version-specific SQL templates to target PostgreSQL 14 (Rebase the version-specific SQL templates to target PostgreSQL 14 #10054)"), so the read-only regression is recent; the interactive add/remove gaps are longer-standing.tables/templates/columns/sql/default/properties.sql,tables/columns/static/js/column.ui.js(inSchemaWithColumnCheck),tables/static/js/table.ui.js(inherit add/remove), and the sharedSchemaView/DataGridViewedit/delete cells (deletable.js,expandabledFormView.jsx) which read row options without subscribing.