Re: Readline support in psql -- worked earlier for me

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Readline support in psql -- worked earlier for me
Дата
Msg-id 19058.1213898810@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Readline support in psql -- worked earlier for me  ("Peter Kovacs" <maxottovonstirlitz@gmail.com>)
Ответы Re: Readline support in psql -- worked earlier for me  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-admin
"Peter Kovacs" <maxottovonstirlitz@gmail.com> writes:
> Gosh, it is working now -- now that I am connected to my local
> postgresql instance. I assume psql's behavior doesn't depend on the
> version/location/readline-support of backend, correct?

I just found that psql on my Fedora machine ignores ~/.inputrc,
just like you said.  Some poking around turned up the reason;

$ env | grep -i inp
INPUTRC=/etc/inputrc

Per the readline manual:

    Any user can customize programs that use Readline by
    putting commands in an "inputrc" file, conventionally in his home
    directory.  The name of this file is taken from the value of the
    environment variable `INPUTRC'.  If that variable is unset, the default
    is `~/.inputrc'.  If that file does not exist or cannot be read, the
    ultimate default is `/etc/inputrc'.

Further poking found this in /etc/profile:

if [ -z "$INPUTRC" -a ! -f "$HOME/.inputrc" ]; then
    INPUTRC=/etc/inputrc
fi

So the answer seems to be that if you create an ~/.inputrc that wasn't
there before, it won't work till you start a new shell, at least if
you've got a system that presets INPUTRC for you like this.

I find this pretty stupid, actually, since per the manual readline
can fall back to /etc/inputrc all by itself; all the /etc/profile code
is accomplishing is to screw up this corner case.  Off to file something
in bugzilla.

            regards, tom lane

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

Предыдущее
От: "Kevin Grittner"
Дата:
Сообщение: Re: Revoke for a new role
Следующее
От: Dilip Patel
Дата:
Сообщение: Recover Password