Re: ON CONFLICT DO SELECT (take 3) - Mailing list pgsql-hackers

From jian he
Subject Re: ON CONFLICT DO SELECT (take 3)
Date
Msg-id CACJufxGWg3vgOt=xaFeX9A_EzQZuUQa7ck1mLNSxozU+oJmJ8A@mail.gmail.com
Whole thread Raw
In response to Re: ON CONFLICT DO SELECT (take 3)  (Viktor Holmberg <v@viktorh.net>)
Responses Re: ON CONFLICT DO SELECT (take 3)
List pgsql-hackers
On Fri, Nov 14, 2025 at 10:34 PM Viktor Holmberg <v@viktorh.net> wrote:
>
> Here are some updates that needed to be done after the improvements to the RLS docs / tests in 7dc4fa & 2e8424.
>
hi.

I see this:
https://commitfest.postgresql.org/patch/6109/
already mentioned all the related discussion links.

Could you also include the discussion link in the commit message?
currently this
spread across several email threads, adding the link would help others
understand the context.

----------------------------
create table x(key int4, fruit text);
create unique index x_idx on x(key);
create role alice;
grant all on schema public to alice;
grant insert on x to alice;
grant select(key) on x to alice;
set role alice;
explain (costs off, verbose) insert into x as i values (1, 'Apple') on
conflict (key) do select where i.fruit = 'Apple' returning 1;
explain (costs off, verbose) insert into x as i values (1, 'Apple') on
conflict (key) do select returning 1;

The above simple tests seem to show ON CONFLICT DO SELECT
permission working as intended, (I didn't try harder this time).

It looks like we currently lack permission-related regression tests
(no ``ERROR:  permission denied for``),
we obviously need more.


--
jian
https://www.enterprisedb.com/



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Update timezone to C99
Next
From: Nathan Bossart
Date:
Subject: Re: postgresql.conf.sample tab width