Re: Logical Replication WIP

From: Petr Jelinek <petr(dot)jelinek(at)2ndquadrant(dot)com>
To: Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>
Cc: Erik Rijkers <er(at)xs4all(dot)nl>, Andres Freund <andres(at)anarazel(dot)de>, Steve Singer <steve(at)ssinger(dot)info>, Craig Ringer <craig(at)2ndquadrant(dot)com>, Simon Riggs <simon(at)2ndquadrant(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>, pgsql-hackers-owner(at)postgresql(dot)org
Subject: Re: Logical Replication WIP
Date: 2016-12-10 07:48:55
Message-ID: ed24d725-1b8c-ed25-19c6-61410e6b1ec6@2ndquadrant.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 09/12/16 17:08, Peter Eisentraut wrote:
> Here is a "fixup" patch for
> 0002-Add-PUBLICATION-catalogs-and-DDL-v11.patch.gz with some minor fixes.
>

Thanks, merged.

> Two issues that should be addressed:
>
> 1. I think ALTER PUBLICATION does not need to require CREATE privilege
> on the database. That should be easy to change.
>

Right, I removed the check.

> 2. By requiring only SELECT privilege to include a table in a
> publication, someone could include a table without replica identity into
> a publication and thus prevent updates to the table.
>
> A while ago I had been working on a patch to create a new PUBLICATION
> privilege for this purpose. I have attached the in-progress patch here.
> We could either finish that up and include it, or commit your patch
> initially with requiring superuser and then refine the permissions later.
>

Hmm, good catch. I changed the SELECT privilege check to owner check for
now, that seems relatively reasonable.

I agree that we should eventually have special privilege for that
though. But then we also need to invent privileges for PUBLICATIONs
themselves for this to work reasonably as you need to be owner of
PUBLICATION to add tables right now, so having PUBLICATION privilege on
table does not seem to do an awful lot. Also I think if we add table
privilege for this it's probably better named as PUBLISH rather than
PUBLICATION but that's not really important.

Attached new version with your updates and rebased on top of the current
HEAD (the partitioning patch produced quite a few conflicts).

--
Petr Jelinek http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services

Attachment Content-Type Size
0001-Add-support-for-temporary-replication-slots-v12.patch.gz application/gzip 7.6 KB
0002-Add-PUBLICATION-catalogs-and-DDL-v12.patch.gz application/gzip 29.5 KB
0003-Add-SUBSCRIPTION-catalog-and-DDL-v12.patch.gz application/gzip 26.9 KB
0004-Define-logical-replication-protocol-and-output-plugi-v12.patch.gz application/gzip 12.7 KB
0005-Add-logical-replication-workers-v12.patch.gz application/gzip 41.6 KB
0006-Add-separate-synchronous-commit-control-for-logical--v12.patch.gz application/gzip 1.6 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Petr Jelinek 2016-12-10 07:50:12 Re: Logical Replication WIP
Previous Message Keith Fiske 2016-12-10 06:52:44 Re: [COMMITTERS] pgsql: Implement table partitioning.