Re: Vertex/Edge label and view

From: Ashutosh Bapat <ashutosh(dot)bapat(dot)oss(at)gmail(dot)com>
To: Peter Eisentraut <peter(at)eisentraut(dot)org>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Vertex/Edge label and view
Date: 2026-09-04 07:34:01
Message-ID: CAExHW5ub_gYauuMk8nuOg3-Yf5CMH2is1kdMfcVFDP05Gs-o3w@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Aug 17, 2026 at 6:48 PM Peter Eisentraut <peter(at)eisentraut(dot)org> wrote:
>
> On 07.08.26 08:47, Ashutosh Bapat wrote:
> > Otherwise, standard needs to define the result of the query when a label
> > exists but is not associated with any element of required type - which
> > essentially would mean returning 0 rows since there are no elements
> > associated with the label.
> >
> > I think we need the standard to define the behaviour in such a case.
>
> The standard does define that behavior: Using a label that is not
> associated with an element of the right type is a syntax error.
>
> What we are not doing correctly is that DROP LABEL should either
> RESTRICT if a view exists or CASCADE, as appropriate.
>
> So there is room for improvement, but I'm not too bothered by the
> current behavior. You get a clear error message and nothing incorrect
> happens.
>

Section 11.25 syntax rule 7 implies that no other database object
should reference a property graph containing the element-label
association being dropped. Applying it in this case we can not drop
the view which references any of the labels in the property graph. So
the DROP should be prohibited in RESTRICT mode and the view should be
dropped in the cascade mode. I will propose the dependency change
along with the test change separately.

--
Best Wishes,
Ashutosh Bapat

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Richard Guo 2026-09-04 07:49:12 Re: Assert failure in try_nestloop_path()
Previous Message Nisha Moond 2026-09-04 07:26:57 Re: Follow-up review items for update_deleted