Re: [17] CREATE SUBSCRIPTION ... SERVER - Mailing list pgsql-hackers

From Jeff Davis
Subject Re: [17] CREATE SUBSCRIPTION ... SERVER
Date
Msg-id d233117a82774de6e606cb383d1e0efea72c8879.camel@j-davis.com
Whole thread Raw
In response to Re: [17] CREATE SUBSCRIPTION ... SERVER  (Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>)
Responses Re: [17] CREATE SUBSCRIPTION ... SERVER
List pgsql-hackers
On Tue, 2024-01-30 at 16:17 +0530, Ashutosh Bapat wrote:
> Converting a server and user mapping to
> conninfo should be delegated to the FDW being used since that FDW
> knows best how to use those options.

If I understand you correctly, you mean that there would be a new
optional function associated with an FDW (in addition to the HANDLER
and VALIDATOR) like "CONNECTION", which would be able to return the
conninfo from a server using that FDW. Is that right?

I like the idea -- it further decouples the logic from the core server.
I suspect it will make postgres_fdw the primary way (though not the
only possible way) to use this feature. There would be little need to
create a new builtin FDW to make this work.

To get the subscription invalidation right, we'd need to make the
(reasonable) assumption that the connection information is based only
on the FDW, server, and user mapping. A FDW wouldn't be able to use,
for example, some kind of configuration table or GUC to control how the
connection string gets created. That's easy enough to solve with
documentation.

I'll work up a new patch for this.


Regards,
    Jeff Davis




pgsql-hackers by date:

Previous
From: Heikki Linnakangas
Date:
Subject: Re: Fix some ubsan/asan related issues
Next
From: Tom Lane
Date:
Subject: Re: Oversight in reparameterize_path_by_child leading to executor crash