]> granicus.if.org Git - postgresql/commit
Protect dblink from invalid options when using postgres_fdw server
authorJoe Conway <mail@joeconway.com>
Thu, 22 Dec 2016 17:19:34 +0000 (09:19 -0800)
committerJoe Conway <mail@joeconway.com>
Thu, 22 Dec 2016 17:19:34 +0000 (09:19 -0800)
commit150841fb94f651a8e452d7a452c3225c2dafdf16
treed9e1a942890dc17f14af714820e7e7b1d84e1c8d
parent60ad2ff586b1bb37930460f4fbba9e4a1c83ded1
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
contrib/dblink/dblink.c