'bar' shouldn't be a string in example
The following documentation comment has been logged on the website:
Page: https://www.postgresql.org/docs/16/sql-alterforeigndatawrapper.html
Description:
Hi,
Re. this example:
ALTER FOREIGN DATA WRAPPER dbi OPTIONS (ADD foo '1', DROP 'bar');
I think "bar" is akin to "foo" and therefore should be similarly an option?
(i.e. not a string value)?
Many thanks
Tim
On 18 Dec 2023, at 19:06, PG Doc comments form <noreply@postgresql.org> wrote:
ALTER FOREIGN DATA WRAPPER dbi OPTIONS (ADD foo '1', DROP 'bar');
I think "bar" is akin to "foo" and therefore should be similarly an option?
(i.e. not a string value)?
Nice catch, "DROP 'bar'" is considered to be unqualified and thus ADD is
assumed, generating the below options:
postgres=# alter foreign data wrapper dummy options (add foo '1', drop 'bar');
ALTER FOREIGN DATA WRAPPER
postgres=# select fdwoptions from pg_foreign_data_wrapper where fdwname='dummy';
fdwoptions
------------------
{foo=1,drop=bar}
(1 row)
This has been incorrect since forever so I will backpatch this into all
supported versions.
--
Daniel Gustafsson