CONNECTION keyword use in CREATE FOREIGN DATA WRAPPER

Started by Peter Eisentraut23 days ago1 messageshackers
Jump to latest
#1Peter Eisentraut
peter_e@gmx.net

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?