pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
psql \s not working - OS X
2+ messages / 2 participants
[nested] [flat]

* psql \s not working - OS X
@ 2011-06-15 07:03  Joel Jacobson <joel@gluefinance.com>
  0 siblings, 1 reply; 2+ messages in thread

From: Joel Jacobson @ 2011-06-15 07:03 UTC (permalink / raw)
  To: pgsql-general@postgresql.org

I'm trying the new 9.1b2 release and got a weird problem with the \s
command to show the latest history, for some reason it's trying to
write to /dev/tty instead of printing out to stdout:

Joel-Jacobsons-MacBook-Pro:~ joel$ uname -a
Darwin Joel-Jacobsons-MacBook-Pro.local 10.7.4 Darwin Kernel Version
10.7.4: Mon Apr 18 21:24:17 PDT 2011;
root:xnu-1504.14.12~3/RELEASE_X86_64 x86_64
Joel-Jacobsons-MacBook-Pro:~ joel$ export
declare -x Apple_PubSub_Socket_Render="/tmp/launch-pOTElL/Render"
declare -x COMMAND_MODE="unix2003"
declare -x DISPLAY="/tmp/launch-QNeAJR/org.x:0"
declare -x HOME="/Users/joel"
declare -x LC_CTYPE="UTF-8"
declare -x LOGNAME="joel"
declare -x OLDPWD="/Users/joel/Downloads/postgresql-9.1beta2"
declare -x PATH="/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/git/bin:/opt/local/bin:/usr/X11/bin"
declare -x PWD="/Users/joel"
declare -x SHELL="/bin/bash"
declare -x SHLVL="1"
declare -x SSH_AUTH_SOCK="/tmp/launch-ejCA6e/Listeners"
declare -x TERM="xterm-color"
declare -x TERM_PROGRAM="Apple_Terminal"
declare -x TERM_PROGRAM_VERSION="273.1"
declare -x TMPDIR="/var/folders/FZ/FZOPIjkcF2GR0xFiNEkxME+++TI/-Tmp-/"
declare -x USER="joel"
declare -x __CF_USER_TEXT_ENCODING="0x1F5:0:0"
Joel-Jacobsons-MacBook-Pro:~ joel$ /Library/PostgreSQL/9.1b2/bin/psql glue
psql (9.1beta2)
Type "help" for help.

glue=# SELECT version();

version
-------------------------------------------------------------------------------------------------------------------------------------------------
 PostgreSQL 9.1beta2 on x86_64-apple-darwin10.7.4, compiled by
i686-apple-darwin10-gcc-4.2.1 (GCC) 4.2.1 (Apple Inc. build 5666) (dot
3), 64-bit
(1 row)

glue=# \s
could not save history to file "/dev/tty": Operation not permitted

glue=#



^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: [GENERAL] psql \s not working - OS X
@ 2011-06-15 15:16  Tom Lane <tgl@sss.pgh.pa.us>
  parent: Joel Jacobson <joel@gluefinance.com>
  0 siblings, 0 replies; 2+ messages in thread

From: Tom Lane @ 2011-06-15 15:16 UTC (permalink / raw)
  To: Joel Jacobson <joel@gluefinance.com>; +Cc: pgsql-bugs

Joel Jacobson <joel@gluefinance.com> writes:
> I'm trying the new 9.1b2 release and got a weird problem with the \s
> command to show the latest history, for some reason it's trying to
> write to /dev/tty instead of printing out to stdout:

> glue=# \s
> could not save history to file "/dev/tty": Operation not permitted

Yeah, it's always done that.  libedit thinks it should do chmod()
on the target file, which while not inherently unreasonable is
guaranteed to spit up on /dev/tty.

Another problem with implementing \s-to-display as save-to-/dev/tty
is that if something did come out, it would be in libedit's rather ugly
encoded format.  libreadline happens to save the history file without
any decoration, but it's improper of us to depend on that.

We really ought to get rid of that implementation entirely and have
a separate code path for \s-to-display, which for extra credit could
go through the pager.

			regards, tom lane



^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2011-06-15 15:16 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2011-06-15 07:03 psql \s not working - OS X Joel Jacobson <joel@gluefinance.com>
2011-06-15 15:16 ` Tom Lane <tgl@sss.pgh.pa.us>

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