pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: Use checkAsUser for selectivity estimator checks, if it's set.
6+ messages / 1 participants
[nested] [flat]

* pgsql: Use checkAsUser for selectivity estimator checks, if it's set.
@ 2019-05-06 11:09  Dean Rasheed <dean.a.rasheed@gmail.com>
  0 siblings, 0 replies; 6+ messages in thread

From: Dean Rasheed @ 2019-05-06 11:09 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Use checkAsUser for selectivity estimator checks, if it's set.

In examine_variable() and examine_simple_variable(), when checking the
user's table and column privileges to determine whether to grant
access to the pg_statistic data, use checkAsUser for the privilege
checks, if it's set. This will be the case if we're accessing the
table via a view, to indicate that we should perform privilege checks
as the view owner rather than the current user.

This change makes this planner check consistent with the check in the
executor, so the planner will be able to make use of statistics if the
table is accessible via the view. This fixes a performance regression
introduced by commit e2d4ef8de8, which affects queries against
non-security barrier views in the case where the user doesn't have
privileges on the underlying table, but the view owner does.

Note that it continues to provide the same safeguards controlling
access to pg_statistic for direct table access (in which case
checkAsUser won't be set) and for security barrier views, because of
the nearby checks on rte->security_barrier and rte->securityQuals.

Back-patch to all supported branches because e2d4ef8de8 was.

Dean Rasheed, reviewed by Jonathan Katz and Stephen Frost.

Branch
------
master

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

Modified Files
--------------
src/backend/utils/adt/selfuncs.c         | 20 +++++++--
src/test/regress/expected/privileges.out | 71 ++++++++++++++++++++++++++++----
src/test/regress/sql/privileges.sql      | 25 +++++++++--
3 files changed, 101 insertions(+), 15 deletions(-)



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

* pgsql: Use checkAsUser for selectivity estimator checks, if it's set.
@ 2019-05-06 11:09  Dean Rasheed <dean.a.rasheed@gmail.com>
  0 siblings, 0 replies; 6+ messages in thread

From: Dean Rasheed @ 2019-05-06 11:09 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Use checkAsUser for selectivity estimator checks, if it's set.

In examine_variable() and examine_simple_variable(), when checking the
user's table and column privileges to determine whether to grant
access to the pg_statistic data, use checkAsUser for the privilege
checks, if it's set. This will be the case if we're accessing the
table via a view, to indicate that we should perform privilege checks
as the view owner rather than the current user.

This change makes this planner check consistent with the check in the
executor, so the planner will be able to make use of statistics if the
table is accessible via the view. This fixes a performance regression
introduced by commit e2d4ef8de8, which affects queries against
non-security barrier views in the case where the user doesn't have
privileges on the underlying table, but the view owner does.

Note that it continues to provide the same safeguards controlling
access to pg_statistic for direct table access (in which case
checkAsUser won't be set) and for security barrier views, because of
the nearby checks on rte->security_barrier and rte->securityQuals.

Back-patch to all supported branches because e2d4ef8de8 was.

Dean Rasheed, reviewed by Jonathan Katz and Stephen Frost.

Branch
------
REL9_5_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/01256815a6304c114c47c2ca70fb752a3ec81ac3

Modified Files
--------------
src/backend/utils/adt/selfuncs.c         | 20 +++++++--
src/test/regress/expected/privileges.out | 71 ++++++++++++++++++++++++++++----
src/test/regress/sql/privileges.sql      | 25 +++++++++--
3 files changed, 101 insertions(+), 15 deletions(-)



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

* pgsql: Use checkAsUser for selectivity estimator checks, if it's set.
@ 2019-05-06 11:09  Dean Rasheed <dean.a.rasheed@gmail.com>
  0 siblings, 0 replies; 6+ messages in thread

From: Dean Rasheed @ 2019-05-06 11:09 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Use checkAsUser for selectivity estimator checks, if it's set.

In examine_variable() and examine_simple_variable(), when checking the
user's table and column privileges to determine whether to grant
access to the pg_statistic data, use checkAsUser for the privilege
checks, if it's set. This will be the case if we're accessing the
table via a view, to indicate that we should perform privilege checks
as the view owner rather than the current user.

This change makes this planner check consistent with the check in the
executor, so the planner will be able to make use of statistics if the
table is accessible via the view. This fixes a performance regression
introduced by commit e2d4ef8de8, which affects queries against
non-security barrier views in the case where the user doesn't have
privileges on the underlying table, but the view owner does.

Note that it continues to provide the same safeguards controlling
access to pg_statistic for direct table access (in which case
checkAsUser won't be set) and for security barrier views, because of
the nearby checks on rte->security_barrier and rte->securityQuals.

Back-patch to all supported branches because e2d4ef8de8 was.

Dean Rasheed, reviewed by Jonathan Katz and Stephen Frost.

Branch
------
REL_10_STABLE

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

Modified Files
--------------
src/backend/utils/adt/selfuncs.c         | 20 +++++++--
src/test/regress/expected/privileges.out | 71 ++++++++++++++++++++++++++++----
src/test/regress/sql/privileges.sql      | 25 +++++++++--
3 files changed, 101 insertions(+), 15 deletions(-)



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

* pgsql: Use checkAsUser for selectivity estimator checks, if it's set.
@ 2019-05-06 11:09  Dean Rasheed <dean.a.rasheed@gmail.com>
  0 siblings, 0 replies; 6+ messages in thread

From: Dean Rasheed @ 2019-05-06 11:09 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Use checkAsUser for selectivity estimator checks, if it's set.

In examine_variable() and examine_simple_variable(), when checking the
user's table and column privileges to determine whether to grant
access to the pg_statistic data, use checkAsUser for the privilege
checks, if it's set. This will be the case if we're accessing the
table via a view, to indicate that we should perform privilege checks
as the view owner rather than the current user.

This change makes this planner check consistent with the check in the
executor, so the planner will be able to make use of statistics if the
table is accessible via the view. This fixes a performance regression
introduced by commit e2d4ef8de8, which affects queries against
non-security barrier views in the case where the user doesn't have
privileges on the underlying table, but the view owner does.

Note that it continues to provide the same safeguards controlling
access to pg_statistic for direct table access (in which case
checkAsUser won't be set) and for security barrier views, because of
the nearby checks on rte->security_barrier and rte->securityQuals.

Back-patch to all supported branches because e2d4ef8de8 was.

Dean Rasheed, reviewed by Jonathan Katz and Stephen Frost.

Branch
------
REL9_6_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/71185228cce85ccdfb2beeebb851e829b1a7a751

Modified Files
--------------
src/backend/utils/adt/selfuncs.c         | 20 +++++++--
src/test/regress/expected/privileges.out | 71 ++++++++++++++++++++++++++++----
src/test/regress/sql/privileges.sql      | 25 +++++++++--
3 files changed, 101 insertions(+), 15 deletions(-)



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

* pgsql: Use checkAsUser for selectivity estimator checks, if it's set.
@ 2019-05-06 11:09  Dean Rasheed <dean.a.rasheed@gmail.com>
  0 siblings, 0 replies; 6+ messages in thread

From: Dean Rasheed @ 2019-05-06 11:09 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Use checkAsUser for selectivity estimator checks, if it's set.

In examine_variable() and examine_simple_variable(), when checking the
user's table and column privileges to determine whether to grant
access to the pg_statistic data, use checkAsUser for the privilege
checks, if it's set. This will be the case if we're accessing the
table via a view, to indicate that we should perform privilege checks
as the view owner rather than the current user.

This change makes this planner check consistent with the check in the
executor, so the planner will be able to make use of statistics if the
table is accessible via the view. This fixes a performance regression
introduced by commit e2d4ef8de8, which affects queries against
non-security barrier views in the case where the user doesn't have
privileges on the underlying table, but the view owner does.

Note that it continues to provide the same safeguards controlling
access to pg_statistic for direct table access (in which case
checkAsUser won't be set) and for security barrier views, because of
the nearby checks on rte->security_barrier and rte->securityQuals.

Back-patch to all supported branches because e2d4ef8de8 was.

Dean Rasheed, reviewed by Jonathan Katz and Stephen Frost.

Branch
------
REL_11_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/98dad4cd48e362090b30187441e8c116afb74f58

Modified Files
--------------
src/backend/utils/adt/selfuncs.c         | 20 +++++++--
src/test/regress/expected/privileges.out | 71 ++++++++++++++++++++++++++++----
src/test/regress/sql/privileges.sql      | 25 +++++++++--
3 files changed, 101 insertions(+), 15 deletions(-)



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

* pgsql: Use checkAsUser for selectivity estimator checks, if it's set.
@ 2019-05-06 11:09  Dean Rasheed <dean.a.rasheed@gmail.com>
  0 siblings, 0 replies; 6+ messages in thread

From: Dean Rasheed @ 2019-05-06 11:09 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Use checkAsUser for selectivity estimator checks, if it's set.

In examine_variable() and examine_simple_variable(), when checking the
user's table and column privileges to determine whether to grant
access to the pg_statistic data, use checkAsUser for the privilege
checks, if it's set. This will be the case if we're accessing the
table via a view, to indicate that we should perform privilege checks
as the view owner rather than the current user.

This change makes this planner check consistent with the check in the
executor, so the planner will be able to make use of statistics if the
table is accessible via the view. This fixes a performance regression
introduced by commit e2d4ef8de8, which affects queries against
non-security barrier views in the case where the user doesn't have
privileges on the underlying table, but the view owner does.

Note that it continues to provide the same safeguards controlling
access to pg_statistic for direct table access (in which case
checkAsUser won't be set) and for security barrier views, because of
the nearby checks on rte->security_barrier and rte->securityQuals.

Back-patch to all supported branches because e2d4ef8de8 was.

Dean Rasheed, reviewed by Jonathan Katz and Stephen Frost.

Branch
------
REL9_4_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/3c09999098519da6b601df878e326eed701201ba

Modified Files
--------------
src/backend/utils/adt/selfuncs.c         | 34 +++++++++++----
src/test/regress/expected/privileges.out | 71 ++++++++++++++++++++++++++++----
src/test/regress/sql/privileges.sql      | 25 +++++++++--
3 files changed, 112 insertions(+), 18 deletions(-)



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


end of thread, other threads:[~2019-05-06 11:09 UTC | newest]

Thread overview: 6+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2019-05-06 11:09 pgsql: Use checkAsUser for selectivity estimator checks, if it's set. Dean Rasheed <dean.a.rasheed@gmail.com>
2019-05-06 11:09 pgsql: Use checkAsUser for selectivity estimator checks, if it's set. Dean Rasheed <dean.a.rasheed@gmail.com>
2019-05-06 11:09 pgsql: Use checkAsUser for selectivity estimator checks, if it's set. Dean Rasheed <dean.a.rasheed@gmail.com>
2019-05-06 11:09 pgsql: Use checkAsUser for selectivity estimator checks, if it's set. Dean Rasheed <dean.a.rasheed@gmail.com>
2019-05-06 11:09 pgsql: Use checkAsUser for selectivity estimator checks, if it's set. Dean Rasheed <dean.a.rasheed@gmail.com>
2019-05-06 11:09 pgsql: Use checkAsUser for selectivity estimator checks, if it's set. Dean Rasheed <dean.a.rasheed@gmail.com>

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