Re: running logical replication as the subscription owner

From: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
To: Ajin Cherian <itsajin(at)gmail(dot)com>
Cc: Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com>, Robert Haas <robertmhaas(at)gmail(dot)com>, Noah Misch <noah(at)leadboat(dot)com>, Jeff Davis <pgsql(at)j-davis(dot)com>, Jelte Fennema <postgres(at)jeltef(dot)nl>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>, Andres Freund <andres(at)anarazel(dot)de>
Subject: Re: running logical replication as the subscription owner
Date: 2023-05-16 06:36:08
Message-ID: CAA4eK1LLUGXAUTjNQ8QZKh8bF59o=iAGxENdfRmQ4eYxPtS0tw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, May 12, 2023 at 5:25 PM Ajin Cherian <itsajin(at)gmail(dot)com> wrote:
>
> On Fri, May 12, 2023 at 1:49 PM Amit Kapila <amit(dot)kapila16(at)gmail(dot)com> wrote:
> >
>
> I tried the following test:
>
> ====================
> Repeat On the publisher and subscriber:
> /* Create role regress_alice with NOSUPERUSER on
> publisher and subscriber and a table for replication */
>
> CREATE ROLE regress_alice NOSUPERUSER LOGIN;
> CREATE ROLE regress_admin SUPERUSER LOGIN;
> GRANT CREATE ON DATABASE postgres TO regress_alice;
> SET SESSION AUTHORIZATION regress_alice;
> CREATE SCHEMA alice;
> GRANT USAGE ON SCHEMA alice TO regress_admin;
> CREATE TABLE alice.test (i INTEGER);
> ALTER TABLE alice.test REPLICA IDENTITY FULL;
>

Why do we need a schema and following grant statement for this test?

> On the publisher:
> postgres=> insert into alice.test values(1);
> postgres=> insert into alice.test values(2);
> postgres=> insert into alice.test values(3);
> postgres=> CREATE PUBLICATION alice FOR TABLE alice.test
> WITH (publish_via_partition_root = true);
>

Again, 'publish_via_partition_root' doesn't seem to be required. Let's
try to write a minimal test for the initial sync behaviour.

--
With Regards,
Amit Kapila.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Amit Kapila 2023-05-16 06:38:50 Re: running logical replication as the subscription owner
Previous Message Michael Paquier 2023-05-16 06:28:17 Re: Move un-parenthesized syntax docs to "compatibility" for few SQL commands