2010/8/3 Robert Haas <robertmhaas@gmail.com>:
> On Mon, Aug 2, 2010 at 11:17 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> Robert Haas <robertmhaas@gmail.com> writes:
>>> On Mon, Aug 2, 2010 at 10:49 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>>>> I'm tempted
>>>> to suggest forgetting about any user-configurable parameter and just
>>>> provide code that strcmp's the $EDITOR value to see if it recognizes the
>>>> editor name, otherwise do nothing.
>>
>>> With all due respect, that sounds like an amazingly bad idea. Surely,
>>> we'll be forever getting patches to add $MYFAVORITEEDITOR to the list,
>>> or complaints that it's not already included.
>>
>> Well, yeah, that's the idea. I say that beats a constant stream of
>> complaints that $MYFAVORITEEDITOR no longer works at all --- which
>> is what your concern was, no?
>
> Well, it'd still work fine for \e foo. It'll just blow up for \e foo
> 3. My concern isn't really that things that which work now will break
> so much as that this new feature will fail to work for a large
> percentage of the people who try to use it, including virtually
> everyone who tries to use it on Win32.
>
>>> While this is
>>> superficially a Nice Thing to Have and I would certainly support it if
>>> +linenumber were relatively universal, it's really a pretty minor
>>> convenience when you come right down to it, and I am not at all
>>> convinced it is worth the hassle of trying to divine what piece of
>>> syntax will equip the user's choice of editor with the necessary
>>> amount of clue.
>>
>> The other approach we could take is that this whole thing is disabled by
>> default, and you have to set a psql variable EDITOR_LINENUMBER_SWITCH
>> to turn it on. If you haven't read the documentation enough to find
>> out that variable exists, well, no harm no foul.
>
> That might be reasonable. Right now the default behavior is to do
> +line on Linux and /line on Windows. But maybe a more sensible
> default would be to fail with an error message that says "you have to
> set thus-and-so variable if you want to use this feature". That seems
> better than sometimes working and sometimes failing depending on what
> editor the user has configured.
>
I like this idea
> A side question is whether this should be an environment variable or a
> psql variable.
>
it can be just psql variable.
Pavel
> --
> Robert Haas
> EnterpriseDB: http://www.enterprisedb.com
> The Enterprise Postgres Company
>