pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: Remove unnecessary failure cases in RemoveRoleFromObjectPolicy()
6+ messages / 1 participants
[nested] [flat]

* pgsql: Remove unnecessary failure cases in RemoveRoleFromObjectPolicy()
@ 2021-06-25 18:00 Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 6+ messages in thread

From: Tom Lane @ 2021-06-25 18:00 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Remove unnecessary failure cases in RemoveRoleFromObjectPolicy().

It's not really necessary for this function to open or lock the
relation associated with the pg_policy entry it's modifying.  The
error checks it's making on the rel are if anything counterproductive
(e.g., if we don't want to allow installation of policies on system
catalogs, here is not the place to prevent that).  In particular, it
seems just wrong to insist on an ownership check.  That has the net
effect of forcing people to use superuser for DROP OWNED BY, which
surely is not an effect we want.  Also there is no point in rebuilding
the dependencies of the policy expressions, which aren't being
changed.  Lastly, locking the table also seems counterproductive; it's
not helping to prevent race conditions, since we failed to re-read the
pg_policy row after acquiring the lock.  That means that concurrent
DDL would likely result in "tuple concurrently updated/deleted"
errors; which is the same behavior this code will produce, with less
overhead.

Per discussion of bug #17062.  Back-patch to all supported versions,
as the failure cases this eliminates seem just as undesirable in 9.6
as in HEAD.

Discussion: https://postgr.es/m/1573181.1624220108@sss.pgh.pa.us

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/5a0f1c8c0193f0dd7fba50c22d96781fa2414007

Modified Files
--------------
src/backend/commands/policy.c | 195 ++++++++++--------------------------------
1 file changed, 47 insertions(+), 148 deletions(-)



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* pgsql: Remove unnecessary failure cases in RemoveRoleFromObjectPolicy()
@ 2021-06-25 18:00 Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 6+ messages in thread

From: Tom Lane @ 2021-06-25 18:00 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Remove unnecessary failure cases in RemoveRoleFromObjectPolicy().

It's not really necessary for this function to open or lock the
relation associated with the pg_policy entry it's modifying.  The
error checks it's making on the rel are if anything counterproductive
(e.g., if we don't want to allow installation of policies on system
catalogs, here is not the place to prevent that).  In particular, it
seems just wrong to insist on an ownership check.  That has the net
effect of forcing people to use superuser for DROP OWNED BY, which
surely is not an effect we want.  Also there is no point in rebuilding
the dependencies of the policy expressions, which aren't being
changed.  Lastly, locking the table also seems counterproductive; it's
not helping to prevent race conditions, since we failed to re-read the
pg_policy row after acquiring the lock.  That means that concurrent
DDL would likely result in "tuple concurrently updated/deleted"
errors; which is the same behavior this code will produce, with less
overhead.

Per discussion of bug #17062.  Back-patch to all supported versions,
as the failure cases this eliminates seem just as undesirable in 9.6
as in HEAD.

Discussion: https://postgr.es/m/1573181.1624220108@sss.pgh.pa.us

Branch
------
REL_13_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/ba815f00a0ce4c9b7696be6d841733b1b481a1f8

Modified Files
--------------
src/backend/commands/policy.c | 195 ++++++++++--------------------------------
1 file changed, 47 insertions(+), 148 deletions(-)



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* pgsql: Remove unnecessary failure cases in RemoveRoleFromObjectPolicy()
@ 2021-06-25 18:00 Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 6+ messages in thread

From: Tom Lane @ 2021-06-25 18:00 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Remove unnecessary failure cases in RemoveRoleFromObjectPolicy().

It's not really necessary for this function to open or lock the
relation associated with the pg_policy entry it's modifying.  The
error checks it's making on the rel are if anything counterproductive
(e.g., if we don't want to allow installation of policies on system
catalogs, here is not the place to prevent that).  In particular, it
seems just wrong to insist on an ownership check.  That has the net
effect of forcing people to use superuser for DROP OWNED BY, which
surely is not an effect we want.  Also there is no point in rebuilding
the dependencies of the policy expressions, which aren't being
changed.  Lastly, locking the table also seems counterproductive; it's
not helping to prevent race conditions, since we failed to re-read the
pg_policy row after acquiring the lock.  That means that concurrent
DDL would likely result in "tuple concurrently updated/deleted"
errors; which is the same behavior this code will produce, with less
overhead.

Per discussion of bug #17062.  Back-patch to all supported versions,
as the failure cases this eliminates seem just as undesirable in 9.6
as in HEAD.

Discussion: https://postgr.es/m/1573181.1624220108@sss.pgh.pa.us

Branch
------
REL_12_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/f851696a21b2893cd927930bef10c377837c634f

Modified Files
--------------
src/backend/commands/policy.c | 195 ++++++++++--------------------------------
1 file changed, 47 insertions(+), 148 deletions(-)



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* pgsql: Remove unnecessary failure cases in RemoveRoleFromObjectPolicy()
@ 2021-06-25 18:00 Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 6+ messages in thread

From: Tom Lane @ 2021-06-25 18:00 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Remove unnecessary failure cases in RemoveRoleFromObjectPolicy().

It's not really necessary for this function to open or lock the
relation associated with the pg_policy entry it's modifying.  The
error checks it's making on the rel are if anything counterproductive
(e.g., if we don't want to allow installation of policies on system
catalogs, here is not the place to prevent that).  In particular, it
seems just wrong to insist on an ownership check.  That has the net
effect of forcing people to use superuser for DROP OWNED BY, which
surely is not an effect we want.  Also there is no point in rebuilding
the dependencies of the policy expressions, which aren't being
changed.  Lastly, locking the table also seems counterproductive; it's
not helping to prevent race conditions, since we failed to re-read the
pg_policy row after acquiring the lock.  That means that concurrent
DDL would likely result in "tuple concurrently updated/deleted"
errors; which is the same behavior this code will produce, with less
overhead.

Per discussion of bug #17062.  Back-patch to all supported versions,
as the failure cases this eliminates seem just as undesirable in 9.6
as in HEAD.

Discussion: https://postgr.es/m/1573181.1624220108@sss.pgh.pa.us

Branch
------
REL_11_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/fea89d64e8e461a6e0f41e9bbfb8756cacfa8b2b

Modified Files
--------------
src/backend/commands/policy.c | 192 +++++++++++-------------------------------
1 file changed, 47 insertions(+), 145 deletions(-)



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* pgsql: Remove unnecessary failure cases in RemoveRoleFromObjectPolicy()
@ 2021-06-25 18:00 Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 6+ messages in thread

From: Tom Lane @ 2021-06-25 18:00 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Remove unnecessary failure cases in RemoveRoleFromObjectPolicy().

It's not really necessary for this function to open or lock the
relation associated with the pg_policy entry it's modifying.  The
error checks it's making on the rel are if anything counterproductive
(e.g., if we don't want to allow installation of policies on system
catalogs, here is not the place to prevent that).  In particular, it
seems just wrong to insist on an ownership check.  That has the net
effect of forcing people to use superuser for DROP OWNED BY, which
surely is not an effect we want.  Also there is no point in rebuilding
the dependencies of the policy expressions, which aren't being
changed.  Lastly, locking the table also seems counterproductive; it's
not helping to prevent race conditions, since we failed to re-read the
pg_policy row after acquiring the lock.  That means that concurrent
DDL would likely result in "tuple concurrently updated/deleted"
errors; which is the same behavior this code will produce, with less
overhead.

Per discussion of bug #17062.  Back-patch to all supported versions,
as the failure cases this eliminates seem just as undesirable in 9.6
as in HEAD.

Discussion: https://postgr.es/m/1573181.1624220108@sss.pgh.pa.us

Branch
------
REL_10_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/f5b780c45ca6d8d4cd4d325ae4b3b60f75179472

Modified Files
--------------
src/backend/commands/policy.c | 192 +++++++++++-------------------------------
1 file changed, 47 insertions(+), 145 deletions(-)



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* pgsql: Remove unnecessary failure cases in RemoveRoleFromObjectPolicy()
@ 2021-06-25 18:00 Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 6+ messages in thread

From: Tom Lane @ 2021-06-25 18:00 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Remove unnecessary failure cases in RemoveRoleFromObjectPolicy().

It's not really necessary for this function to open or lock the
relation associated with the pg_policy entry it's modifying.  The
error checks it's making on the rel are if anything counterproductive
(e.g., if we don't want to allow installation of policies on system
catalogs, here is not the place to prevent that).  In particular, it
seems just wrong to insist on an ownership check.  That has the net
effect of forcing people to use superuser for DROP OWNED BY, which
surely is not an effect we want.  Also there is no point in rebuilding
the dependencies of the policy expressions, which aren't being
changed.  Lastly, locking the table also seems counterproductive; it's
not helping to prevent race conditions, since we failed to re-read the
pg_policy row after acquiring the lock.  That means that concurrent
DDL would likely result in "tuple concurrently updated/deleted"
errors; which is the same behavior this code will produce, with less
overhead.

Per discussion of bug #17062.  Back-patch to all supported versions,
as the failure cases this eliminates seem just as undesirable in 9.6
as in HEAD.

Discussion: https://postgr.es/m/1573181.1624220108@sss.pgh.pa.us

Branch
------
REL9_6_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/9c7a150aec71702be24174d3a73533030356374c

Modified Files
--------------
src/backend/commands/policy.c | 191 +++++++++++-------------------------------
1 file changed, 47 insertions(+), 144 deletions(-)



^ permalink  raw  reply  [nested|flat] 6+ messages in thread


end of thread, other threads:[~2021-06-25 18:00 UTC | newest]

Thread overview: 6+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2021-06-25 18:00 pgsql: Remove unnecessary failure cases in RemoveRoleFromObjectPolicy() Tom Lane <tgl@sss.pgh.pa.us>
2021-06-25 18:00 pgsql: Remove unnecessary failure cases in RemoveRoleFromObjectPolicy() Tom Lane <tgl@sss.pgh.pa.us>
2021-06-25 18:00 pgsql: Remove unnecessary failure cases in RemoveRoleFromObjectPolicy() Tom Lane <tgl@sss.pgh.pa.us>
2021-06-25 18:00 pgsql: Remove unnecessary failure cases in RemoveRoleFromObjectPolicy() Tom Lane <tgl@sss.pgh.pa.us>
2021-06-25 18:00 pgsql: Remove unnecessary failure cases in RemoveRoleFromObjectPolicy() Tom Lane <tgl@sss.pgh.pa.us>
2021-06-25 18:00 pgsql: Remove unnecessary failure cases in RemoveRoleFromObjectPolicy() Tom Lane <tgl@sss.pgh.pa.us>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox