Re: expand_dbname in postgres_fdw

From: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Ashutosh Bapat <ashutosh(dot)bapat(at)enterprisedb(dot)com>, Arseny Sher <a(dot)sher(at)postgrespro(dot)ru>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: expand_dbname in postgres_fdw
Date: 2017-07-26 18:44:10
Message-ID: 20170726184410.cbctodpqydvgdo5h@alvherre.pgsql
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Robert Haas wrote:
> On Wed, Jul 26, 2017 at 5:38 AM, Ashutosh Bapat
> <ashutosh(dot)bapat(at)enterprisedb(dot)com> wrote:
> > According to F.34.1.1 at [1] passing connection string as dbname
> > option should work, so your question is valid. I am not aware of any
> > discussion around this on hackers. Comments in connect_pg_server()
> > don't help either. But I guess, we expect users to set up individual
> > foreign server and user mapping options instead of putting those in a
> > connection string. I can not think of any reason except that it
> > improves readability. If postgres_fdw wants to take certain actions
> > based on the values of individual options, having them separate is
> > easier to handle than parsing them out of a connection string.
> >
> > Any way, if we are not going to change current behaviour, we should
> > change the documentation and say that option dbname means "database
> > name" and not a connection string.
>
> I kind of wonder if this had some security aspect to it? But not sure.

Yeah, me too. As I recall, if the flag is not set, parameters set by
the FDW server earlier in the conninfo can be changed by params that
appear in the dbname. Offhand I can't see any obvious security
implications, but then I've not thought about it very hard.

--
Álvaro Herrera https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2017-07-26 18:51:59 Re: expand_dbname in postgres_fdw
Previous Message Tom Lane 2017-07-26 18:41:24 Re: Change in "policy" on dump ordering?