Re: Explicit psqlrc - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Explicit psqlrc
Date
Msg-id 15696.1267975372@sss.pgh.pa.us
Whole thread Raw
In response to Re: Explicit psqlrc  (Magnus Hagander <magnus@hagander.net>)
Responses Re: Explicit psqlrc
Re: Explicit psqlrc
List pgsql-hackers
Magnus Hagander <magnus@hagander.net> writes:
> 2010/3/6 Tom Lane <tgl@sss.pgh.pa.us>:
>> The analogy I was thinking about was psql -X, but I agree that it's
>> not obvious why this shouldn't be thought of as an additional -f file.

> Uh, I don't follow. When we use -f, we'll run the script and then
> exit. The whole point is to run it and *not* exit, since you are
> normally using it to set up the environment in psql.

If we were going to support multiple -f options, it would be sensible
to interpret "-f -" as "read from stdin until EOF".  Then you could
interleave prepared scripts and stdin, which could be pretty handy.
The default behavior would be equivalent to a single instance of "-f -",
and what you are looking for would be "-X -f substitute-psqlrc -f -".

I do think this is potentially cleaner and more general than the
--psqlrc switch.  Maybe that should be reverted and the whole topic
reconsidered during 9.1 devel cycle.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Magnus Hagander
Date:
Subject: Re: Explicit psqlrc
Next
From: Magnus Hagander
Date:
Subject: Re: Explicit psqlrc