dblink get_connect_string() passes FDW option "updatable" to the connect string, connection fails. - Mailing list pgsql-hackers

From Corey Huinker
Subject dblink get_connect_string() passes FDW option "updatable" to the connect string, connection fails.
Date
Msg-id CADkLM=fWyXVEyYcqbcRnxcHutkP45UHU9WD7XpdZaMfe7S=RwA@mail.gmail.com
Whole thread Raw
Responses Re: dblink get_connect_string() passes FDW option "updatable" to the connect string, connection fails.
Re: dblink get_connect_string() passes FDW option "updatable" to the connect string, connection fails.
List pgsql-hackers
I ran into this today:

select current_database() as current_db \gset
CREATE EXTENSION postgres_fdw;
CREATE EXTENSION
CREATE EXTENSION dblink;
CREATE EXTENSION
CREATE ROLE bob LOGIN PASSWORD 'bob';
CREATE ROLE
CREATE SERVER bob_srv FOREIGN DATA WRAPPER postgres_fdw OPTIONS ( host 'localhost', dbname :'current_db' );
CREATE SERVER
CREATE USER MAPPING FOR public SERVER bob_srv OPTIONS ( user 'bob', password 'bob' );
CREATE USER MAPPING
SELECT *
FROM dblink('bob_srv','SELECT 1') as t(x integer);
 x 
---
 1
(1 row)

ALTER SERVER bob_srv OPTIONS (updatable 'true');
ALTER SERVER
SELECT *
FROM dblink('bob_srv','SELECT 1') as t(x integer);
psql:bug_example.sql:18: ERROR:  could not establish connection
DETAIL:  invalid connection option "updatable"

Is this something we want to fix?
If so, are there any other fdw/server/user-mapping options that we don't want to pass along to the connect string?

Steps to re-create:

bug_example.sh:#!/bin/bash
dropdb bug_example
dropuser bob
createdb bug_example
psql bug_example -f bug_example.sql

bug_example.sql:

\set ECHO all

select current_database() as current_db \gset

CREATE EXTENSION postgres_fdw;
CREATE EXTENSION dblink;
CREATE ROLE bob LOGIN PASSWORD 'bob';
CREATE SERVER bob_srv FOREIGN DATA WRAPPER postgres_fdw OPTIONS ( host 'localhost', dbname :'current_db' );
CREATE USER MAPPING FOR public SERVER bob_srv OPTIONS ( user 'bob', password 'bob' );

SELECT *
FROM dblink('bob_srv','SELECT 1') as t(x integer);

ALTER SERVER bob_srv OPTIONS (updatable 'true');

SELECT *
FROM dblink('bob_srv','SELECT 1') as t(x integer);

pgsql-hackers by date:

Previous
From: "Tsunakawa, Takayuki"
Date:
Subject: Re: Remove the comment on the countereffectiveness of large shared_buffers on Windows
Next
From: "Tsunakawa, Takayuki"
Date:
Subject: Re: Patch: Implement failover on libpq connect level.