Re: [WIP] CREATE SUBSCRIPTION with FOR TABLES clause (table filter)

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Michael Paquier <michael(at)paquier(dot)xyz>
Cc: Andrey Borodin <x4mmm(at)yandex-team(dot)ru>, Evgeniy Efimkin <efimkin(at)yandex-team(dot)ru>, Stephen Frost <sfrost(at)snowman(dot)net>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>, Дмитрий Сарафанников <dsarafan(at)yandex-team(dot)ru>, Владимир Бородин <root(at)simply(dot)name>
Subject: Re: [WIP] CREATE SUBSCRIPTION with FOR TABLES clause (table filter)
Date: 2019-03-13 13:47:15
Message-ID: CA+TgmobqXGe_7dcX1_Dv8+kaf3NEoe5Sy4NXGB9AyfM5YDjsGQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Mar 4, 2019 at 1:55 AM Michael Paquier <michael(at)paquier(dot)xyz> wrote:
> - To create a subscription, the user must be a superuser.
> + To add tables to a subscription, the user must have ownership rights on the
> + table.
> [...]
> + /* must have CREATE privilege on database */
> + aclresult = pg_database_aclcheck(MyDatabaseId, GetUserId(), ACL_CREATE);
> + if (aclresult != ACLCHECK_OK)
> + aclcheck_error(aclresult, OBJECT_DATABASE,
> + get_database_name(MyDatabaseId));
> So this means that we degrade subscription creation requirement from
> being a superuser to someone having CREATE rights on a given
> database?

I find that entirely unacceptable, for reasons which I also talked
about on the other thread where this was discussed:

https://www.postgresql.org/message-id/CA+TgmoahEoM2zZO71yv4883HFarXcBcOs3if6fEdRcRs8Fs=zA@mail.gmail.com

Letting unprivileged users initiate outbound network traffic and
more-or-less permanent background processes seems like a terrible
idea.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tomas Vondra 2019-03-13 13:47:26 Re: performance issue in remove_from_unowned_list()
Previous Message Robert Haas 2019-03-13 13:43:42 Re: Special role for subscriptions