Re: PSQLRC environment variable.

Поиск
Список
Период
Сортировка
От Bruce Momjian
Тема Re: PSQLRC environment variable.
Дата
Msg-id 200403140326.i2E3QSk24516@candle.pha.pa.us
обсуждение исходный текст
Ответ на Re: PSQLRC environment variable.  (Bruce Momjian <pgman@candle.pha.pa.us>)
Ответы Re: PSQLRC environment variable.  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-patches
Bruce Momjian wrote:
> Bruce Momjian wrote:
> > Tom Lane wrote:
> > > Bruce Momjian <pgman@candle.pha.pa.us> writes:
> > > > Tom Lane wrote:
> > > >> Uh, why is that a good idea?
> > >
> > > > Well, suppose you want all your users to use the same psqlrc file.
> > > > Instead of creating symlinks for every user, you can just set PSQLRC in
> > > > /etc/profile and everyone gets it.
> > >
> > > ... but people who want to make their own .psqlrc can't?  At least not
> > > till it occurs to them to unset PSQLRC?  I don't really see the use-case
> > > here.  James' stated problem of setting a default search_path could be
> >
> > If they want their own, the just unset PSQLRC in their .profile.
> >
> > > handled at least as effectively through either PGOPTIONS or server-side
> > > GUC settings (postgresql.conf, or per-user or per-database variable
> > > settings).
> > >
> > > I'm not averse to inventing PSQLRC if there's actually some case it
> > > solves better than any of our existing mechanisms.  But so far it seems
> > > like a solution desperately in search of a problem.
> >
> > I think most/all applications that look for a file in the user directory
> > have either a global place they look too, or a way to control where to
> > look for it.  This seems pretty Unix standard, I think we should follow
> > that.
>
> What if we allow the environment variable to specify a global file to
> read in addition to the home directory .psqlrc file?  That seems even
> more useful.

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?

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

В списке pgsql-patches по дате отправления:

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: contrib/xml2 function name change and minor bitrot
Следующее
От: Bruce Momjian
Дата:
Сообщение: Re: change output of \dp