[Patch] Block ALTER TABLE RENAME COLUMN when column is used by property graph
SATYANARAYANA NARLAPURAM <satyanarlapuram@gmail.com>
From: SATYANARAYANA NARLAPURAM <satyanarlapuram@gmail.com>
To: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>, Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
Date: 2026-04-23T06:53:45Z
Lists: pgsql-hackers
Attachments
- 0001-Block-ALTER-TABLE-RENAME-COLUMN-when-column-is-used-.patch (application/octet-stream) patch 0001
Hi hackers,
When a table column is referenced by a property graph, the property
name stored in pg_propgraph_property.pgpname would become stale after
a column rename. This caused GRAPH_TABLE queries to fail with the new
column name ("property does not exist") while the old (dead) name
continued to work. pg_get_propgraphdef() would also emit confusing
output like "new_col AS old_col".
Fix by checking pg_depend in renameatt_internal() for
PropgraphLabelPropertyRelationId entries that reference the column
being renamed. If any exist, raise an error directing the user to
drop the property graph first.
Thanks,
Satya