Odd cruft in .psql_history in HEAD

Lists: pgsql-hackers
From: Jim Nasby <decibel(at)decibel(dot)org>
To: "pgsql-hackers(at)postgresql(dot)org Hackers" <pgsql-hackers(at)postgresql(dot)org>
Subject: Odd cruft in .psql_history in HEAD
Date: 2010-01-14 02:36:11
Message-ID: 84969FFC-427E-4C22-B0DC-2154E1FA1A35@decibel.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

I noticed odd stuff showing up when I fired up an 8.3 psql after using psql in HEAD. It shows up in .psql_history as well:

decibel(at)platter(dot)1[20:32]~:5%tail -n 2 .psql_history
\134df+\040tools.raise_exception
\df+ tools.raise_exception
decibel(at)platter(dot)1[20:35]~:6%

(last entry is from the 8.3 psql)
--
Jim C. Nasby, Database Architect jim(at)nasby(dot)net
512.569.9461 (cell) http://jim.nasby.net


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Jim Nasby <decibel(at)decibel(dot)org>
Cc: "pgsql-hackers(at)postgresql(dot)org Hackers" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Odd cruft in .psql_history in HEAD
Date: 2010-01-14 03:32:17
Message-ID: 13521.1263439937@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Jim Nasby <decibel(at)decibel(dot)org> writes:
> I noticed odd stuff showing up when I fired up an 8.3 psql after using psql in HEAD. It shows up in .psql_history as well:

Platform? readline version?

regards, tom lane


From: Jim Nasby <decibel(at)decibel(dot)org>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "pgsql-hackers(at)postgresql(dot)org Hackers" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Odd cruft in .psql_history in HEAD
Date: 2010-02-11 00:07:51
Message-ID: E36050BC-DC86-43B2-96C1-A4849697D6DE@decibel.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Jan 13, 2010, at 9:32 PM, Tom Lane wrote:
> Jim Nasby <decibel(at)decibel(dot)org> writes:
>> I noticed odd stuff showing up when I fired up an 8.3 psql after using psql in HEAD. It shows up in .psql_history as well:
>
> Platform? readline version?

This is on snow leopard. FWIW it's still doing it with today's HEAD.

decibel(at)platter(dot)1[18:05]~/pgsql/HEAD:9%port installed readline|grep active
readline @6.0.000_2+darwin (active)
decibel(at)platter(dot)1[18:05]~/pgsql/HEAD:10%uname -a
Darwin platter 10.2.0 Darwin Kernel Version 10.2.0: Tue Nov 3 10:37:10 PST 2009; root:xnu-1486.2.11~1/RELEASE_I386 i386
decibel(at)platter(dot)1[18:05]~/pgsql/HEAD:11%

(Original thread is at http://archives.postgresql.org/pgsql-hackers/2010-01/msg01414.php; sorry it took so long to get back to this).
--
Jim C. Nasby, Database Architect jim(at)nasby(dot)net
512.569.9461 (cell) http://jim.nasby.net


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Jim Nasby <decibel(at)decibel(dot)org>
Cc: "pgsql-hackers(at)postgresql(dot)org Hackers" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Odd cruft in .psql_history in HEAD
Date: 2010-02-11 02:47:15
Message-ID: 27703.1265856435@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Jim Nasby <decibel(at)decibel(dot)org> writes:
> On Jan 13, 2010, at 9:32 PM, Tom Lane wrote:
>> Jim Nasby <decibel(at)decibel(dot)org> writes:
>>> I noticed odd stuff showing up when I fired up an 8.3 psql after using psql in HEAD. It shows up in .psql_history as well:
>>
>> Platform? readline version?

> This is on snow leopard. FWIW it's still doing it with today's HEAD.

Oh. On OSX the regular readline (really libedit) library likes to put
strange stuff into history files --- it turns spaces, backslashes,
and I don't know what else into backslash-octal escape sequences.
It manages to reverse the transformation just fine on read though.

What it looks like to me is that you've started linking psql with
some other version of readline that doesn't follow that convention,
and accordingly shows you strange things from the history file.
When/if you go back to libedit, it likely won't like the history
entries the other library made.

Short answer: stick to one readline library.

regards, tom lane