Re: Explicit psqlrc

From: Magnus Hagander <magnus(at)hagander(dot)net>
To: David Christensen <david(at)endpoint(dot)com>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Explicit psqlrc
Date: 2010-03-05 10:30:22
Message-ID: 9837222c1003050230m23fe64edg2a5304efe118dd85@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

2010/3/5 Magnus Hagander <magnus(at)hagander(dot)net>:
> 2010/3/5 David Christensen <david(at)endpoint(dot)com>:
>>
>> On Mar 4, 2010, at 4:00 PM, Magnus Hagander wrote:
>>
>>> I've now for the second time found myself wanting to specify an
>>> explicit psqlrc file instead of just parsing ~/.psqlrc, so attached is
>>> a patch that accepts the PSQLRC environment variable to control which
>>> psqlrc file is used.
>>>
>>> Any objections to this (obviously including documentation - this is
>>> just the trivial code)
>>
>>
>> My bikeshed has a --psqlrc path/to/file, but +1 on the idea.
>
> The main reason I went with environment variable is that it's the
> path-of-least-code :-) And it easily fullfills my use-cases for it,
> which has me launching interactive psql with completely different
> settings from a script.
>
> Do you have a use-case where --psqlrc would be more useful than an
> environment variable, or is it *only* bike-shedding? ;)

Just to be clear, the code difference isn't very large. Attached is a
patch that does both PSQLRC and --psqlrc.

--
Magnus Hagander
Me: http://www.hagander.net/
Work: http://www.redpill-linpro.com/

Attachment Content-Type Size
psqlrc.patch application/octet-stream 3.3 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Stephen Frost 2010-03-05 13:18:33 Re: Repetition of warning message while REVOKE
Previous Message Dave Page 2010-03-05 10:19:52 Re: Visual Studio 2005, C-language function - avoiding hacks?