Re: Default connection parameters for postgres_fdw and dblink

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Albe Laurenz <laurenz(dot)albe(at)wien(dot)gv(dot)at>
Cc: "Tom Lane *EXTERN*" <tgl(at)sss(dot)pgh(dot)pa(dot)us>, "pgsql-hackers(at)postgreSQL(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Default connection parameters for postgres_fdw and dblink
Date: 2013-03-27 13:12:42
Message-ID: CA+TgmobuPT8jgc81Oo-+V0zoDzqqrze6OOoAFq9C5HQz_C+9Dg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Mar 25, 2013 at 4:38 AM, Albe Laurenz <laurenz(dot)albe(at)wien(dot)gv(dot)at> wrote:
> I agree that this is an unhappy situation.
>
> If possible, I would suggest the following defaults (that's what I as
> a user would expect without thinking too hard):
> 1) Default the user to the current effective database user.
> 2) Default the port to 5432.
> 3) Default the database name to the current database name.

+1.

> Speaking about exposing the server environment, I have been bitten
> before by the fact that the default client encoding is taken from
> the server's PGCLIENTENCODING at postmaster start time, but that's
> slightly off topic.

Yeah. I really hate environment variables as a way of setting
defaults for things, because they tend to start creeping into
unfortunate places. It's not so bad to have one or two, but when you
start to have PGDATA, PGPORT, PGUSER, PGSERVICE, PGSERVICEFILE,
PGSSLMODE, PGCONNECT_TIMEOUT, PGHOST, PGHOSTADDR, PGREALM, PGOPTIONS,
PGAPPNAME, PGREQUIRESSL, PGSSLCOMPRESSION, PGSYSCONFDIR, PGLOCALEDIR,
PGSSLROOTCERT, PGSSLCERT, PGGEQO, PGTZ, PGDATESTYLE, PGCLIENTENCODING,
PGKRBSRVNAME, PGGSSLIB, PGPASSFILE, OLDDATADIR, NEWDATADIR, OLDBINDIR,
NEWBINDIR, and probably a few others I'm missing, it becomes very
difficult to sanitize an environment (such as the postmaster) against
undesirable intrusions.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Simon Riggs 2013-03-27 13:13:21 Re: pgsql: Allow external recovery_config_directory
Previous Message Simon Riggs 2013-03-27 13:11:48 Re: [COMMITTERS] pgsql: Allow external recovery_config_directory