Re: running logical replication as the subscription owner
Jelte Fennema <postgres@jeltef.nl>
From: Jelte Fennema <postgres@jeltef.nl>
To: Robert Haas <robertmhaas@gmail.com>
Cc: Mark Dilger <mark.dilger@enterprisedb.com>,
Jeff Davis <pgsql@j-davis.com>, "pgsql-hackers@postgresql.org" <pgsql-hackers@postgresql.org>,
Andres Freund <andres@anarazel.de>, Noah Misch <noah@leadboat.com>
Date: 2023-03-27T22:08:40Z
Lists: pgsql-hackers
Attachments
- v2-0001-Perform-logical-replication-actions-as-the-table-.patch (application/octet-stream) patch v2-0001
> I don't get it. If we just return, that would result in skipping > changes rather than erroring out on changes, but it wouldn't preserve > the current behavior, because we'd still care about the table owner's > permissions rather than, as now, the subscription owner's permissions. Attached is an updated version of your patch with what I had in mind (admittedly it needed one more line than "just" the return to make it work). But as you can see all previous tests for a lowly privileged subscription owner that **cannot** SET ROLE to the table owner continue to work as they did before. While still downgrading to the table owners role when the subscription owner **can** SET ROLE to the table owner. Obviously this needs some comments explaining what's going on and probably some code refactoring and/or variable renaming, but I hope it's clear what I meant now: For high privileged subscription owners, we downgrade to the permissions of the table owner, but for low privileged ones we care about permissions of the subscription owner itself.
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