Re: SQL Property Graph Queries (SQL/PGQ)

From: Ashutosh Bapat <ashutosh(dot)bapat(dot)oss(at)gmail(dot)com>
To: Amit Langote <amitlangote09(at)gmail(dot)com>
Cc: Peter Eisentraut <peter(at)eisentraut(dot)org>, Junwang Zhao <zhjwpku(at)gmail(dot)com>, Vik Fearing <vik(at)postgresfriends(dot)org>, Ajay Pal <ajay(dot)pal(dot)k(at)gmail(dot)com>, Imran Zaheer <imran(dot)zhir(at)gmail(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: SQL Property Graph Queries (SQL/PGQ)
Date: 2025-12-08 14:58:59
Message-ID: CAExHW5vgWTK3rTE1Twr3qp6EmMPz6BgxUKs1Ou-f3nE9Smn62w@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Dec 8, 2025 at 5:56 PM Amit Langote <amitlangote09(at)gmail(dot)com> wrote:
>
> On Thu, Dec 4, 2025 at 2:23 AM Ashutosh Bapat
>
> In your commit message:
>
> 4. We have not implemented security definer property graphs since
> SQL/PGQ standard does not mention those.
>
> My reading of the access rules is that, from the caller’s point of
> view, the standard expects behavior that is quite close to
> security-definer semantics -- once the session user has SELECT on the
> property graph, they do not need privileges on the element tables. Is
> that also how you read it, or do you see the standard as intentionally
> leaving room for invoker semantics like you've currently implemented?
>

The standard specifies that in order to reference a property graph in
the query, the query invoker has to have SELECT privileges on the
property graph. I am not able to find a specification which answers:
who's privileges should be used to access the underlying tables. So I
can't say whether it's close to security-definer semantics or not. I
also can not infer any intent. But as I have explained above,
security-definer semantics seem to be too dangerous to implement. But
may be there's some other safe interpretation of standard
specification, which I am missing.

--
Best Wishes,
Ashutosh Bapat

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2025-12-08 15:09:15 Re: Simplify the way of appending comma to stringInfo
Previous Message jian he 2025-12-08 14:58:00 Re: CAST(... ON DEFAULT) - WIP build on top of Error-Safe User Functions