pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Michael Paquier <michael@paquier.xyz>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Remove INSERT privilege check at table creation of CTAS and matv
Date: Sat, 21 Nov 2020 10:46:06 +0000
Message-ID: <E1kgQP8-0002X5-Ns@gemulon.postgresql.org> (raw)

Remove INSERT privilege check at table creation of CTAS and matview

As per discussion with Peter Eisentraunt, the SQL standard specifies
that any tuple insertion done as part of CREATE TABLE AS happens without
any extra ACL check, so it makes little sense to keep a check for INSERT
privileges when using WITH DATA.  Materialized views are not part of the
standard, but similarly, this check can be confusing as this refers to
an access check on a table created within the same command as the one
that would insert data into this table.

This commit removes the INSERT privilege check for WITH DATA, the
default, that 846005e removed partially, but only for WITH NO DATA.

Author: Bharath Rupireddy
Discussion: https://postgr.es/m/d049c272-9a47-d783-46b0-46665b011598@enterprisedb.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/878f3a19c6c8ff197e4a33f51d921a4abafcc494

Modified Files
--------------
doc/src/sgml/ref/create_materialized_view.sgml |  3 +-
doc/src/sgml/ref/create_table_as.sgml          |  4 +-
src/backend/commands/createas.c                | 26 --------
src/test/regress/expected/matview.out          | 24 ++++---
src/test/regress/expected/select_into.out      | 86 ++++++++++++--------------
src/test/regress/sql/matview.sql               | 10 +--
src/test/regress/sql/select_into.sql           | 40 ++++--------
7 files changed, 75 insertions(+), 118 deletions(-)



Message-ID: <E1kgQP8-0002X5-Ns@gemulon.postgresql.org>
Permalink:  ../E1kgQP8-0002X5-Ns@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1kgQP8-0002X5-Ns@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: michael@paquier.xyz
  Subject: Re: pgsql: Remove INSERT privilege check at table creation of CTAS and matv
  In-Reply-To: <E1kgQP8-0002X5-Ns@gemulon.postgresql.org>
  References: <E1kgQP8-0002X5-Ns@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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