From: Peter Eisentraut <peter@eisentraut.org>
To: pgsql-hackers <pgsql-hackers@postgresql.org>
Subject: CONNECTION keyword use in CREATE FOREIGN DATA WRAPPER
Date: Fri, 28 Aug 2026 17:50:00 +0200
Message-ID: <3a890e4f-98ac-48a0-bc83-e465616ba1cb@eisentraut.org> (raw)
A new feature in PG19 is that you can equip a foreign data wrapper with
a connection function that can be used by subscriptions, instead of
those subscriptions defining a connection string.
The syntax is
CREATE FOREIGN DATA WRAPPER ... CONNECTION function_name
I find that this is confusing compared to the existing
CREATE SUBSCRIPTION ... CONNECTION 'connection-string'
These two are closely related, per this feature, so the use of the same
keyword for two quite different things seems unfortunate.
I suggest that CREATE FOREIGN DATA WRAPPER should use a different
keyword. Option 1 would be something like CONNECTOR, which would match
well with the existing HANDLER and VALIDATOR. Option 2 might be
something like CONNECTION FUNCTION, which avoids a new keyword, and
matches a bit with CONNECTION LIMIT.
Thoughts?
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-hackers@postgresql.org
Cc: peter@eisentraut.org
Subject: Re: CONNECTION keyword use in CREATE FOREIGN DATA WRAPPER
In-Reply-To: <3a890e4f-98ac-48a0-bc83-e465616ba1cb@eisentraut.org>
References: <3a890e4f-98ac-48a0-bc83-e465616ba1cb@eisentraut.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox