</para>
<para>
If an <literal>INSERT</literal> has an <literal>ON CONFLICT DO
- NOTHING/UPDATE</literal> clause, <literal>SELECT</literal>
+ UPDATE</literal> clause, or an <literal>ON CONFLICT DO
+ NOTHING</literal> clause with an arbiter index or constraint
+ specification, then <literal>SELECT</literal>
permissions are required on the relation, and the rows proposed for
insertion are checked using the relation's <literal>SELECT</literal>
policies. If a row proposed for insertion does not satisfy the
<row>
<entry><command>INSERT ... ON CONFLICT</command></entry>
<entry>
- Check new row <footnote id="rls-on-conflict-priv">
+ Check new row <footnote>
+ <para>
+ If an arbiter index or constraint is specified.
+ </para>
+ </footnote><footnote id="rls-on-conflict-priv">
<para>
Row proposed for insertion is checked regardless of whether or not a
conflict occurs.
1 | tgt d | TGT D
(1 row)
--- INSERT ... ON CONFLICT DO NOTHING should apply INSERT CHECK and SELECT USING
--- policy clauses (to new value, whether it conflicts or not)
+-- INSERT ... ON CONFLICT DO NOTHING with an arbiter clause should apply
+-- INSERT CHECK and SELECT USING policy clauses (to new value, whether it
+-- conflicts or not)
INSERT INTO rls_test_tgt VALUES (1, 'tgt a') ON CONFLICT (a) DO NOTHING;
NOTICE: INSERT CHECK on rls_test_tgt.(1,"tgt a","TGT A")
NOTICE: SELECT USING on rls_test_tgt.(1,"tgt a","TGT A")
BEGIN; DELETE FROM rls_test_tgt WHERE a = 1; ROLLBACK;
DELETE FROM rls_test_tgt RETURNING *;
--- INSERT ... ON CONFLICT DO NOTHING should apply INSERT CHECK and SELECT USING
--- policy clauses (to new value, whether it conflicts or not)
+-- INSERT ... ON CONFLICT DO NOTHING with an arbiter clause should apply
+-- INSERT CHECK and SELECT USING policy clauses (to new value, whether it
+-- conflicts or not)
INSERT INTO rls_test_tgt VALUES (1, 'tgt a') ON CONFLICT (a) DO NOTHING;
INSERT INTO rls_test_tgt VALUES (1, 'tgt b') ON CONFLICT (a) DO NOTHING;