Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1wFoec-005aGI-1s for pgsql-hackers@arkaria.postgresql.org; Thu, 23 Apr 2026 07:39:19 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wFoeb-000SwM-2S for pgsql-hackers@arkaria.postgresql.org; Thu, 23 Apr 2026 07:39:17 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1wFoeb-000SwE-1O for pgsql-hackers@lists.postgresql.org; Thu, 23 Apr 2026 07:39:17 +0000 Received: from mail-vs1-xe2f.google.com ([2607:f8b0:4864:20::e2f]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1wFoeZ-00000002by6-1lnC for pgsql-hackers@lists.postgresql.org; Thu, 23 Apr 2026 07:39:17 +0000 Received: by mail-vs1-xe2f.google.com with SMTP id ada2fe7eead31-606045ef716so4504466137.0 for ; Thu, 23 Apr 2026 00:39:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1776929953; cv=none; d=google.com; s=arc-20240605; b=fNbpLdphrF9g1H2BtD1GTk//ck2eyXOBvDHitffavihxR8Ak+Cyvw4WtLBKqmmSr9x Jo4aDLh9L3F9QndvaLFx0dmoCjM91ZRj1g8//+d5ar1tK3y8xL1wuoF9vaBrYzvk6pL7 jWHpZizJ8y2R6ED8vowwKbzq16+o0uc0rQWtxECmQ2OJ5baDIrQcPx4raEePyv8qAukk VpEHd4+kJuDaHIgDWz00FpPKI+tE2Qa03r0Z5UU7pPHYgXOHMeIirxM0RMQVZGZWo7xY Pnv0NAe+21sCJJ0urXATFt7B5sIZmigiT7xJx3FKkzLTClNec8fNq2+sv2/dpSHDjMjr UPCw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:dkim-signature; bh=t31krilsSvLl61X6QFVZl0kzLTQ2YXWrZTvUQIRicUE=; fh=aLFlIwLRhjJ62Oi7jfh17CC0bv2ps6dnSrUZCg2hAeg=; b=KiiMp2LyeAaMvw1PwtFafXXF3NUW9HXgusHkhhyLYupDvMHYh/lgbUYv0PnFoli9ob +eLaZ+FxunAcbkDlpPS3aMWgcOP32mwaKGf8nUv7pCWUeHhGqoxCusarmL+NJMpLig/J 7NurUCpZ1KK1+d2hlxtjAQhS1PC7neKS6/q/vLjXXHznyR2G9SHIdvBOco+IdS5EPSbM eOpteheKQ/KrhzyY6GJYv192Mv/TaMFviABXw9cexQQjtFADiThIn1HWDjaRc4X/6Y4L rQ06xGJ/WmWl82YHkEoCi7xM5xF9D1RUSNKuAfFhmx8hDw0A9uJzAcA8ERg/7aYsrBxQ H9kA==; darn=lists.postgresql.org ARC-Authentication-Results: i=1; mx.google.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1776929953; x=1777534753; darn=lists.postgresql.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=t31krilsSvLl61X6QFVZl0kzLTQ2YXWrZTvUQIRicUE=; b=rGsZWKVdbb/uAwe3vpfFF7x+JFoBCv+uoG9pt4GVYPjpQDg5lGfjPowkkrhpS13Bul W/VezTi1SLsvj23OXrXOCpvxz0Yijs74GIk4r1sFFBGylh5sxhgg0k3PS0ujE6YiUyKd Sop2iM9VBt9eBBj0wDiF+uIZZ808YWsPBhASxpDW/uTTxrjbzgi1rfkO3ha2GCNf5+wG Zs9BEDV+CX80mQOJjalhru6QA5BdKdjUyDOOcimlfx3MPMywg+KAxfngcogTVqOLOJFa cmQ3nbAzYjJ1uO52AMmExW1BC6UOa1CnnSy/LXBy8X5Xs0QXRRkcyPkB+g0HyqaJBi8J XYhw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1776929953; x=1777534753; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=t31krilsSvLl61X6QFVZl0kzLTQ2YXWrZTvUQIRicUE=; b=OgB16snVK3O6lJj9Nvv001vlKLekOfQjBNo4CMryeboYgy1vIrhGokUxIV3/wX0GcV qWxYOQQy6hgEmn+H96708jnnAwz8x662EhYvrvbJcIj9AgNVZI9XpVlQxyRlxJv+cvS7 uaG2IZyH5nFiUxo1TNcYFx0kFpZ6cG2ccfCTzEKU3s9mjmvu6xGgHOgI6KL35qpzYCB1 o5VNmjWsD+PZWYL+z60G7Ig/Kt3fIpL4V4Y6eLlzcpOHMjHchWLuSkwIc3L7Uw5FR1MM LcKUKUmrm0L3hJ/i6909czGV2cvsRtgM+FJldMPZKk404e4f8nJ6l6OpMZdbXPFmD7Aa DK7Q== X-Gm-Message-State: AOJu0YwZNqDjLAJfpNtMPRXc+EC1FTsi3+0rX1kBeaGMcuZ5I5DQVFNa jsCbYgioU6bkKcKdjocpgqyH9379GKr89IJvbAuaASm0vb4c96/tBAy6Dz+FXVa0lPEJSvcWJQz fiI0qyW+hw6r1XKUccsJU3r3lKMf0zOM= X-Gm-Gg: AeBDievtwcnY1fgrISv2xS4nWCtJpzKY5w6kM1DhYELIU2JV7vE54s7zR9KpmeQC92l 6bpLcmH1YMUOzp5Bl/rkbGd72ZbuNoJPZILNgXznJnOlDeYmPMIK0Mipt/LiNcs7X3SkPWs3wcq 7EhBLpOWB0Tfy5l1sr6wR1Zc84+pzzAori1LDaU+xkbMur+YPoeUA72xASzqL7hTVnucwfF8Rh6 YUNyq1PeGXXMxaQN/uVajJULSxcgN3xVQLYs+P6PJJgowMNDHMJLlTDiRfkzG2UaVvQ/NCvPOHZ PzXrlYitUzVnXsFWpxG+wvJztNa4EK9pnDwFRr/KDzgV7/79rCk= X-Received: by 2002:a05:6102:c51:b0:605:27db:c899 with SMTP id ada2fe7eead31-616f7c567b2mr13255226137.29.1776929953288; Thu, 23 Apr 2026 00:39:13 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: SATYANARAYANA NARLAPURAM Date: Thu, 23 Apr 2026 00:39:01 -0700 X-Gm-Features: AQROBzDcS5lVJszUCfG8Um8DJVmI8HR7Dik1Q2sIfGvRTnHvss3VYjoVDHYOFGM Message-ID: Subject: Re: [Patch] Block ALTER TABLE RENAME COLUMN when column is used by property graph To: Ashutosh Bapat Cc: PostgreSQL Hackers Content-Type: multipart/alternative; boundary="000000000000a817cd06501bbe69" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --000000000000a817cd06501bbe69 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi On Thu, Apr 23, 2026 at 12:33=E2=80=AFAM Ashutosh Bapat < ashutosh.bapat.oss@gmail.com> wrote: > On Thu, Apr 23, 2026 at 12:23=E2=80=AFPM SATYANARAYANA NARLAPURAM > 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 | Descriptio= n > --------+---------+-----------+----------+---------+---------+-----------= -- > 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 | Descriptio= n > --------+---------+-----------+----------+---------+---------+-----------= -- > 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. Thanks, Satya --000000000000a817cd06501bbe69 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi

On Thu, Apr 23, 2026 at 12:3= 3=E2=80=AFAM Ashutosh Bapat <ashutosh.bapat.oss@gmail.com> wrote:
On Thu, Apr 23, 2026 at 12:23=E2=80=AFPM S= ATYANARAYANA NARLAPURAM
<satyanar= lapuram@gmail.com> 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<= br> > a column rename.=C2=A0 This caused GRAPH_TABLE queries to fail with th= e new
> column name ("property does not exist") while the old (dead)= name
> continued to work.=C2=A0 pg_get_propgraphdef() would also emit confusi= ng
> 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
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0View "public.vt"
=C2=A0Column |=C2=A0 Type=C2=A0 =C2=A0| Collation | Nullable | Default | St= orage | Description
--------+---------+-----------+----------+---------+---------+-------------=
=C2=A0a=C2=A0 =C2=A0 =C2=A0 | integer |=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0|=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 |=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0| plain=C2=A0 =C2=A0|
View definition:
=C2=A0SELECT a
=C2=A0 =C2=A0FROM t1;

#alter table t1 rename column a TO aa;
ALTER TABLE
#\d+ vt
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0View "public.vt"
=C2=A0Column |=C2=A0 Type=C2=A0 =C2=A0| Collation | Nullable | Default | St= orage | Description
--------+---------+-----------+----------+---------+---------+-------------=
=C2=A0a=C2=A0 =C2=A0 =C2=A0 | integer |=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0|=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 |=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0| plain=C2=A0 =C2=A0|
View definition:
=C2=A0SELECT aa AS a
=C2=A0 =C2=A0FROM 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, s= hould we document this or it is a well known fact and not needed? Asking in= the context of Graphs, not views.


Thanks,
Satya=
--000000000000a817cd06501bbe69--