Re: [17] CREATE SUBSCRIPTION ... SERVER

From: Jeff Davis <pgsql(at)j-davis(dot)com>
To: Ashutosh Bapat <ashutosh(dot)bapat(dot)oss(at)gmail(dot)com>
Cc: Bharath Rupireddy <bharath(dot)rupireddyforpostgres(at)gmail(dot)com>, Joe Conway <mail(at)joeconway(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: [17] CREATE SUBSCRIPTION ... SERVER
Date: 2024-01-05 08:04:26
Message-ID: e71e029309171eb8b6ca393306f9bc5acfbfdf8f.camel@j-davis.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, 2024-01-05 at 12:49 +0530, Ashutosh Bapat wrote:
> Can you please provide an example using postgres_fdw to create a
> subscription using this patch. I think we should document it in
> postgres_fdw and add a test for the same.

There's a basic test for postgres_fdw in patch 0003, just testing the
syntax and validation.

A manual end-to-end test is pretty straightforward:

-- on publisher
create table foo(i int primary key);
create publication pub1 for table foo;
insert into foo values(42);

-- on subscriber
create extension postgres_fdw;
create table foo(i int primary key);
create server server1
foreign data wrapper postgres_fdw
options (host '/tmp', port '5432', dbname 'postgres');
create user mapping for u1 server server1
options (user 'u1');
select pg_conninfo_from_server('server1','u1',true);
create subscription sub1 server server1 publication pub1;

I don't think we need to add an end-to-end test for each FDW, because
it's just using the assembled connection string. To see if it's
assembling the connection string properly, we can unit test with
pg_conninfo_from_server().

Regards,
Jeff Davis

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bertrand Drouvot 2024-01-05 08:15:46 Re: Synchronizing slots from primary to standby
Previous Message Bertrand Drouvot 2024-01-05 07:39:39 Re: verify predefined LWLocks have entries in wait_event_names.txt