Received: from localhost (unknown [200.46.204.183]) by developer.postgresql.org (Postfix) with ESMTP id 83A542E0063 for ; Thu, 19 Jun 2008 15:08:49 -0300 (ADT) Received: from developer.postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 64145-02-5 for ; Thu, 19 Jun 2008 15:08:42 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by developer.postgresql.org (Postfix) with ESMTP id 2E52D2E0118 for ; Thu, 19 Jun 2008 15:07:06 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.2/8.14.2) with ESMTP id m5JI6oex019059; Thu, 19 Jun 2008 14:06:50 -0400 (EDT) To: "Peter Kovacs" cc: pgsql-admin@postgresql.org Subject: Re: Readline support in psql -- worked earlier for me In-reply-to: References: <13650.1213889074@sss.pgh.pa.us> <18389.1213896460@sss.pgh.pa.us> Comments: In-reply-to "Peter Kovacs" message dated "Thu, 19 Jun 2008 19:47:36 +0200" Date: Thu, 19 Jun 2008 14:06:50 -0400 Message-ID: <19058.1213898810@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200806/160 X-Sequence-Number: 29498 "Peter Kovacs" 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