pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Peter Kovacs <maxottovonstirlitz@gmail.com>
Cc: pgsql-admin@postgresql.org
Subject: Re: Readline support in psql -- worked earlier for me
Date: Thu, 19 Jun 2008 14:06:50 -0400
Message-ID: <19058.1213898810@sss.pgh.pa.us> (raw)
In-Reply-To: <b6e8f2e80806191047o43ebf9d6l35965527be823ce2@mail.gmail.com>
References: <b6e8f2e80806190615x441426cbn95d8856398cd4e87@mail.gmail.com>
	<13650.1213889074@sss.pgh.pa.us>
	<b6e8f2e80806190836r1b7bef64ke749dda1e29c1a27@mail.gmail.com>
	<18389.1213896460@sss.pgh.pa.us>
	<b6e8f2e80806191047o43ebf9d6l35965527be823ce2@mail.gmail.com>

"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



view thread (10+ messages)  latest in thread

Message-ID: <19058.1213898810@sss.pgh.pa.us>
Permalink:  ../19058.1213898810@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/19058.1213898810@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-admin@postgresql.org
  Cc: tgl@sss.pgh.pa.us, maxottovonstirlitz@gmail.com
  Subject: Re: Readline support in psql -- worked earlier for me
  In-Reply-To: <19058.1213898810@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox