Re: [HACKERS] Patch to psql.c to allow .psqlrc file - Mailing list pgsql-hackers

From (Erik Bennett)
Subject Re: [HACKERS] Patch to psql.c to allow .psqlrc file
Date
Msg-id cbf01ac67ab8cae9a316ab25a2106fff
Whole thread Raw
In response to [HACKERS] Patch to psql.c to allow .psqlrc file  (Andrew Martin <martin@biochemistry.ucl.ac.uk>)
List pgsql-hackers
> > Can I request we search in the postgres install directory first, then
> > the home directory, or is that stupid because there may not be a
> > postgresql install directory on the machine you are running psql on.

> It's trivial to search whatever directories we want to, but using
> /etc/ and $HOME is the convention which every other program I know
> of follows, so I just did the same.
>
> It's certainly true that every machine will have a /etc whereas
> maybe only one machine on a network may have the PG
> installation directory.
>
> I'd vote for leaving it as is...
>
>
> Andrew

How about some sort of PATH variable?
setenv PG_INITPATH    /etc:/usr/local/pgsql:~
or
export PG_INITPATH=/etc:/usr/local/pgsql:/home/bennett

In the absense of the environment variable, it would default to
"/etc:$HOME".

This could be considered a security issue, however.  If someone,
without thinking, put "." in their PG_INITPATH, they could be tricked
into executing something nasty.

 -Erik

Erik Bennett                    bennett@corp.oneworld.com

------------------------------

pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: [HACKERS] Patch to psql.c to allow .psqlrc file
Next
From: (Erik Bennett)
Date:
Subject: Re: [HACKERS] \dt and disk access