Re: expand_dbname in postgres_fdw

From: Arseny Sher <a(dot)sher(at)postgrespro(dot)ru>
To: Ashutosh Bapat <ashutosh(dot)bapat(at)enterprisedb(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Robert Haas <robertmhaas(at)gmail(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: expand_dbname in postgres_fdw
Date: 2017-07-27 10:02:39
Message-ID: 87y3ra9ozk.fsf@ars-thinkpad
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Jul 27, 2017 at 12:21 AM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> The main problem to my mind is that a connection string could possibly
> override items meant to be specified elsewhere. In particular it ought
> not be allowed to specify the remote username or password, because those
> are supposed to come from the user mapping object not the server object.
> I suspect you could break things by trying to specify client_encoding
> there, as well.

Attached patch allows dbname expansion and makes sure that it doesn't
contain any invalid options. Whether you decide to commit it or not
(at the moment I don't see any security implications, at least not more than
in usual dbname expansion usage, e.g. in psql, but who knows), it seems
to me that the documentation should be updated since currently it is not
clear on the subject, as the beginning of this thread proves.

Attachment Content-Type Size
expand_dbname_in_postgres_fdw.patch text/x-diff 5.2 KB
unknown_filename text/plain 96 bytes

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2017-07-27 10:35:54 Re: A couple of postgresql.conf.sample discrepancies
Previous Message Masahiko Sawada 2017-07-27 09:16:50 Re: Increase Vacuum ring buffer.