Re: running logical replication as the subscription owner
Jeff Davis <pgsql@j-davis.com>
From: Jeff Davis <pgsql@j-davis.com>
To: Robert Haas <robertmhaas@gmail.com>, Mark Dilger <mark.dilger@enterprisedb.com>
Cc: "pgsql-hackers@postgresql.org" <pgsql-hackers@postgresql.org>, Andres Freund <andres@anarazel.de>, Noah Misch <noah@leadboat.com>
Date: 2023-03-25T00:26:11Z
Lists: pgsql-hackers
On Fri, 2023-03-24 at 14:35 -0400, Robert Haas wrote: > That > actually wouldn't work today, and with the patch it would start > working, so basically the effect of the patch on the problem that you > mention would be to remove the ability to filter by specific table > and > add the ability to filter by owning role. That's certainly a loss. It makes a lot of sense to want to limit a subscription to only write to certain tables. If you want to filter by role, you can do that today by granting the role, or some role that has the necessary privileges. It takes me a while to re-learn the problems of poorly-written trigger functions, malicious trigger functions, search paths, etc., each time I start working in this area again. Can you include an example of such a trigger function that we're worried about? Can the subscription owner change the search path in the subscription process, and if so, why? The doc here: https://www.postgresql.org/docs/devel/sql-createfunction.html#SQL-CREATEFUNCTION-SECURITY mentions search_path, but other hazards don't really seem applicable. (Is the trigger creating new roles?) Regards, Jeff Davis
Commits
Same data as JSON:
GET /api/v1/messages/:b64id/commits
the thread's linked commits as JSON, with link sources.
API reference →
-
Honor run_as_owner option in tablesync worker.
- a83edeaf684a 16.0 landed
-
Document new pg_subscription columns.
- bc25d6c54a00 16.0 landed
-
Add a run_as_owner option to subscriptions.
- 482675987bcd 16.0 landed
-
Perform logical replication actions as the table owner.
- 1e10d49b65d6 16.0 landed
-
Add new predefined role pg_create_subscription.
- c3afe8cf5a1e 16.0 cited
-
Respect permissions within logical replication.
- a2ab9c06ea15 15.0 cited
-
Empty search_path in logical replication apply worker and walsender.
- 11da97024abb 14.0 cited
-
Empty search_path in Autovacuum and non-psql/pgbench clients.
- 582edc369cdb 11.0 cited