Re: document the dangers of granting TRIGGER or REFERENCES

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Greg Sabino Mullane <htamfids(at)gmail(dot)com>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: document the dangers of granting TRIGGER or REFERENCES
Date: 2026-07-14 18:26:50
Message-ID: 3348034.1784053610@sss.pgh.pa.us
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Greg Sabino Mullane <htamfids(at)gmail(dot)com> writes:
> On Tue, Jul 14, 2026 at 11:54 AM Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>> REFERENCES is required by SQL spec, no?

> Makes me wonder if other database systems suffer from the same issue?

I think a strict-SQL-spec database is probably insulated from the
arbitrary-code-execution problem, because there isn't any way to get
user-defined code involved in executing comparisons. For real-world
systems, you'd have to take a close look at what datatype extension
capabilities they've added.

Of course, a holder of REFERENCES can still block updates and deletes
on your table, so it's not like it's something you'd give out to
untrusted roles anyway. (I wonder if Robert's proposed patch should
be extended to point that out. It's obvious, but so is the issue
with TRIGGER.)

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Greg Sabino Mullane 2026-07-14 18:28:56 Re: [PATCH] Use Boyer-Moore-Horspool for simple LIKE contains patterns
Previous Message Matheus Alcantara 2026-07-14 18:23:40 Re: Proposal: QUALIFY clause