pgsql: Protect dblink from invalid options when using postgres_fdw serv

From: Joe Conway <mail(at)joeconway(dot)com>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Protect dblink from invalid options when using postgres_fdw serv
Date: 2016-12-22 17:20:50
Message-ID: E1cK72w-0000vR-6r@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Protect dblink from invalid options when using postgres_fdw server

When dblink uses a postgres_fdw server name for its connection, it
is possible for the connection to have options that are invalid
with dblink (e.g. "updatable"). The recommended way to avoid this
problem is to use dblink_fdw servers instead. However there are use
cases for using postgres_fdw, and possibly other FDWs, for dblink
connection options, therefore protect against trying to use any
options that do not apply by using is_valid_dblink_option() when
building the connection string from the options.

Back-patch to 9.3. Although 9.2 supports FDWs for connection info,
is_valid_dblink_option() did not yet exist, and neither did
postgres_fdw, at least in the postgres source tree. Given the lack
of previous complaints, fixing that seems too invasive/not worth it.

Author: Corey Huinker
Reviewed-By: Joe Conway
Discussion: https://postgr.es/m/CADkLM%3DfWyXVEyYcqbcRnxcHutkP45UHU9WD7XpdZaMfe7S%3DRwA%40mail.gmail.com

Branch
------
REL9_3_STABLE

Details
-------
http://git.postgresql.org/pg/commitdiff/bd46cce21476792c71952e23543bd943b160d0f1

Modified Files
--------------
contrib/dblink/dblink.c | 35 +++++++++++++++++++++++++++++------
1 file changed, 29 insertions(+), 6 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Joe Conway 2016-12-22 17:20:54 pgsql: Protect dblink from invalid options when using postgres_fdw serv
Previous Message Heikki Linnakangas 2016-12-22 16:45:47 pgsql: Simplify tape block format.