Re: PSQLRC environment variable.

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, James Tanis <jtt(at)sysd(dot)com>, pgsql-patches(at)postgresql(dot)org
Subject: Re: PSQLRC environment variable.
Date: 2004-04-21 03:52:31
Message-ID: 200404210352.i3L3qVe23763@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-patches

Bruce Momjian wrote:
> Tom Lane wrote:
> > Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> writes:
> > > I just checked a few apps and I see they usually allow a global config
> > > file to be specified. How about SYSPSQLRC that adds a system-wide psql
> > > config file to be read before the one in the home directory?
> >
> > The ones I know of that allow such a thing generally hard-wire the
> > location of the global config file at build time, rather than taking it
> > from an environment variable. The env var approach seems weird, and a
> > tad inefficient (since you'd have to put such an env var into the global
> > .profile, meaning it propagates into every single process ever launched
> > on your system). Also I think we have at least one global config file
> > already for libpq, and its location is hard-wired.
>
> Agreed. There is usually one global config file, and SYS* overrides it.
> The global one we have now is pg_service.conf. Maybe we should forget
> the environment variable idea and just have a pgsql.rc.sample file in
> share, with documentation in the file on how to install it. That is
> what we do with pg_service.conf now for libpq.

The attached patch implements a global psql.rc file that is read before
the one in the user's home directory --- doc changes included.

It is configured just like pg_service.conf.

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073

Attachment Content-Type Size
unknown_filename text/plain 6.2 KB

In response to

Responses

Browse pgsql-patches by date

  From Date Subject
Next Message Neil Conway 2004-04-21 17:22:25 doc improv: backup/restore
Previous Message Bruce Momjian 2004-04-21 00:35:36 CSV keyword change