Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id 2AACDB5DBC0 for ; Wed, 15 Jun 2011 12:16:47 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.29]) (amavisd-maia, port 10024) with ESMTP id 82021-02 for ; Wed, 15 Jun 2011 15:16:40 +0000 (UTC) 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 mail.postgresql.org (Postfix) with ESMTP id 0DE76B5DBBF for ; Wed, 15 Jun 2011 12:16:39 -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 p5FFGZsC028665; Wed, 15 Jun 2011 11:16:35 -0400 (EDT) To: Joel Jacobson cc: pgsql-bugs@postgreSQL.org Subject: Re: [GENERAL] psql \s not working - OS X In-reply-to: References: Comments: In-reply-to Joel Jacobson message dated "Wed, 15 Jun 2011 09:03:58 +0200" Date: Wed, 15 Jun 2011 11:16:35 -0400 Message-ID: <28664.1308150995@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.91 tagged_above=-5 required=5 tests=BAYES_00=-1.9, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201106/115 X-Sequence-Number: 30494 Joel Jacobson 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