agora inbox for pgsql-committers@postgresql.org  
help / color / mirror / Atom feed
From: Peter Eisentraut <peter@eisentraut.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Record dependencies on graph labels and properties
Date: Tue, 09 Jun 2026 11:03:06 +0000
Message-ID: <E1wWuEc-001j1o-2U@gemulon.postgresql.org> (raw)

Record dependencies on graph labels and properties

A view definition with GRAPH_TABLE depends upon the property graph it
references as well as the properties and labels referenced in it.  We
recorded the dependency on the property graph, but did not record
dependency on labels and properties.  This allowed properties or
labels referenced by a view to be dropped, resulting in a cache lookup
error when such a view was accessed.  Fix this bug by handling
GraphPropertyRef and GraphLabelRef in find_expr_references_walker().
The dependency on the data type of property does not need to be
recorded separately as it is recorded indirectly via a dependency on
the property graph property itself.

Note that a property or a label associated with individual elements
can still be dropped as long as there are other elements that are
associated with that property or label, since they do not lead to
dropping the property or the label from the property graph altogether.

Reported-by: Man Zeng <zengman@halodbtech.com>
Author: Ayush Tiwari <ayushtiwari.slg01@gmail.com>
Author: Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
Reviewed-by: Junwang Zhao <zhjwpku@gmail.com>
Discussion: https://www.postgresql.org/message-id/flat/tencent_43D9888041FA4FDE498C7BF1%40qq.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/9d8cdcbe0c8aee743e29079bdb2e4b5eeae4c70e

Modified Files
--------------
src/backend/catalog/dependency.c          | 19 ++++++++++++++++
src/include/catalog/catversion.h          |  2 +-
src/test/regress/expected/graph_table.out | 37 +++++++++++++++++++++++--------
src/test/regress/sql/graph_table.sql      | 14 ++++++++++--
4 files changed, 60 insertions(+), 12 deletions(-)



Message-ID: <E1wWuEc-001j1o-2U@gemulon.postgresql.org>
Permalink:  ../E1wWuEc-001j1o-2U@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1wWuEc-001j1o-2U@gemulon.postgresql.org

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: pgsql-committers@postgresql.org
  Cc: peter@eisentraut.org, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Record dependencies on graph labels and properties
  In-Reply-To: <E1wWuEc-001j1o-2U@gemulon.postgresql.org>

* 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