Remove readline notice from psql --version?

Started by Peter Eisentrautover 13 years ago7 messages
#1Peter Eisentraut
peter_e@gmx.net

Currently, psql --version prints something like

psql (PostgreSQL) 9.2beta1
contains support for command-line editing

I think the notice about readline is a leftover from the old days when
psql was often built without any readline support. Nowadays, this looks
like an anomaly, and it doesn't actually contain any information that
would be useful nowadays, such as which particular library is used or
what kind of history support is active. I suggest we remove this second
line, or alternatively, we could add more useful detail, but what?

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Peter Eisentraut (#1)
Re: Remove readline notice from psql --version?

Peter Eisentraut <peter_e@gmx.net> writes:

Currently, psql --version prints something like
psql (PostgreSQL) 9.2beta1
contains support for command-line editing

I think the notice about readline is a leftover from the old days when
psql was often built without any readline support. Nowadays, this looks
like an anomaly, and it doesn't actually contain any information that
would be useful nowadays, such as which particular library is used or
what kind of history support is active. I suggest we remove this second
line, or alternatively, we could add more useful detail, but what?

Hm, I had actually forgotten that was there. When the question of
"which readline library does this use?" has come up in the past,
we've always been able to get an answer from ldd or local equivalent.
I suppose that could fail in the case of statically linked libraries,
but the practical use for the message seems about nil. I'm good with
just removing it.

regards, tom lane

#3David Fetter
david@fetter.org
In reply to: Peter Eisentraut (#1)
Re: Remove readline notice from psql --version?

On Sun, May 20, 2012 at 01:24:21AM +0300, Peter Eisentraut wrote:

Currently, psql --version prints something like

psql (PostgreSQL) 9.2beta1
contains support for command-line editing

I think this should be replaced with a notice about the actual library
used.

Cheers,
David.
--
David Fetter <david@fetter.org> http://fetter.org/
Phone: +1 415 235 3778 AIM: dfetter666 Yahoo!: dfetter
Skype: davidfetter XMPP: david.fetter@gmail.com
iCal: webcal://www.tripit.com/feed/ical/people/david74/tripit.ics

Remember to vote!
Consider donating to Postgres: http://www.postgresql.org/about/donate

#4Alvaro Herrera
alvherre@commandprompt.com
In reply to: David Fetter (#3)
Re: Remove readline notice from psql --version?

Excerpts from David Fetter's message of dom may 20 15:30:52 -0400 2012:

On Sun, May 20, 2012 at 01:24:21AM +0300, Peter Eisentraut wrote:

Currently, psql --version prints something like

psql (PostgreSQL) 9.2beta1
contains support for command-line editing

I think this should be replaced with a notice about the actual library
used.

That was my thought as well, but is it possible to implement it?

--
Álvaro Herrera <alvherre@commandprompt.com>
The PostgreSQL Company - Command Prompt, Inc.
PostgreSQL Replication, Consulting, Custom Development, 24x7 support

#5Tom Lane
tgl@sss.pgh.pa.us
In reply to: Alvaro Herrera (#4)
Re: Remove readline notice from psql --version?

Alvaro Herrera <alvherre@commandprompt.com> writes:

Excerpts from David Fetter's message of dom may 20 15:30:52 -0400 2012:

I think this should be replaced with a notice about the actual library
used.

That was my thought as well, but is it possible to implement it?

And, more to the point, would it be more reliable than checking the
results of system-specific tools such as ldd?

regards, tom lane

#6Alvaro Herrera
alvherre@commandprompt.com
In reply to: Tom Lane (#5)
Re: Remove readline notice from psql --version?

Excerpts from Tom Lane's message of dom may 20 23:04:59 -0400 2012:

Alvaro Herrera <alvherre@commandprompt.com> writes:

Excerpts from David Fetter's message of dom may 20 15:30:52 -0400 2012:

I think this should be replaced with a notice about the actual library
used.

That was my thought as well, but is it possible to implement it?

And, more to the point, would it be more reliable than checking the
results of system-specific tools such as ldd?

If well implemented, my guess is that it would be. For example recall
that in Debian they are shipping psql linked to libedit due to licensing
concerns, but then suggest a hack to use LD_PRELOAD to load libreadline
instead. So ldd might tell you that it's linked to libedit and fail to
notice that at runtime something different is being used.

--
Álvaro Herrera <alvherre@commandprompt.com>
The PostgreSQL Company - Command Prompt, Inc.
PostgreSQL Replication, Consulting, Custom Development, 24x7 support

#7Tom Lane
tgl@sss.pgh.pa.us
In reply to: Alvaro Herrera (#6)
Re: Remove readline notice from psql --version?

Alvaro Herrera <alvherre@commandprompt.com> writes:

Excerpts from Tom Lane's message of dom may 20 23:04:59 -0400 2012:

And, more to the point, would it be more reliable than checking the
results of system-specific tools such as ldd?

If well implemented, my guess is that it would be. For example recall
that in Debian they are shipping psql linked to libedit due to licensing
concerns, but then suggest a hack to use LD_PRELOAD to load libreadline
instead. So ldd might tell you that it's linked to libedit and fail to
notice that at runtime something different is being used.

[ raised eyebrow ... ] Yeah, but exactly what would it take to produce
an output that told the truth in such a situation? I'll bet a large
amount of money that you would need a separate implementation for every
platform. And this problem just is not worth that.

regards, tom lane