public inbox for [email protected]  
help / color / mirror / Atom feed
From: Ashutosh Bapat <[email protected]>
To: SATYANARAYANA NARLAPURAM <[email protected]>
Cc: PostgreSQL Hackers <[email protected]>
Subject: Re: [Patch] Block ALTER TABLE RENAME COLUMN when column is used by property graph
Date: Thu, 23 Apr 2026 14:59:49 +0530
Message-ID: <CAExHW5tz11k1REwVB2HP04bUPbS22JL0LSjUQWEs56J66AHVsQ@mail.gmail.com> (raw)
In-Reply-To: <CAHg+QDdYq0NNF2ueLd1Hvn2njtJL2-MONd-=6REM6_4fHRTnhQ@mail.gmail.com>
References: <CAHg+QDckbpX_Lk-6bz5JA+Bd1+KfsO0=9r0hPZt8X+PX6kbWFw@mail.gmail.com>
	<CAExHW5uBe5QhZMmY68pv8RtvZxhejqB+D6Sr6bs=v17bTtaD+w@mail.gmail.com>
	<CAHg+QDdYq0NNF2ueLd1Hvn2njtJL2-MONd-=6REM6_4fHRTnhQ@mail.gmail.com>

On Thu, Apr 23, 2026 at 1:09 PM SATYANARAYANA NARLAPURAM
<[email protected]> wrote:
>
> Hi
>
> On Thu, Apr 23, 2026 at 12:33 AM Ashutosh Bapat <[email protected]> wrote:
>>
>> On Thu, Apr 23, 2026 at 12:23 PM SATYANARAYANA NARLAPURAM
>> <[email protected]> wrote:
>> >
>> > 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".
>>
>> This behaviour is inline with the behaviour of view.
>>
>> #create view vt as select a from t1;
>> CREATE VIEW
>> #\d+ vt
>>                              View "public.vt"
>>  Column |  Type   | Collation | Nullable | Default | Storage | Description
>> --------+---------+-----------+----------+---------+---------+-------------
>>  a      | integer |           |          |         | plain   |
>> View definition:
>>  SELECT a
>>    FROM t1;
>>
>> #alter table t1 rename column a TO aa;
>> ALTER TABLE
>> #\d+ vt
>>                              View "public.vt"
>>  Column |  Type   | Collation | Nullable | Default | Storage | Description
>> --------+---------+-----------+----------+---------+---------+-------------
>>  a      | integer |           |          |         | plain   |
>> View definition:
>>  SELECT aa AS a
>>    FROM t1;
>>
>> Name of the property is derived from the name of the column it
>> references if the property name is not specified at the time of
>> creating the property. But these two are different. Changing column
>> name can not be expected to change the property name automatically. If
>> two elements have the same label, the set of property names associated
>> with that label is expected to be the same for those two elements as
>> well.
>
>
> Ashutosh, should we document this or it is a well known fact and not needed? Asking in the context of Graphs, not views.

I don't think we need to document it.

--
Best Wishes,
Ashutosh Bapat





view thread (6+ messages)  latest in thread

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected], [email protected]
  Subject: Re: [Patch] Block ALTER TABLE RENAME COLUMN when column is used by property graph
  In-Reply-To: <CAExHW5tz11k1REwVB2HP04bUPbS22JL0LSjUQWEs56J66AHVsQ@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox