From: Jeff Frost <jeff@pgexperts.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: David G. Johnston <david.g.johnston@gmail.com>
Cc: pgsql-bugs@postgresql.org <pgsql-bugs@postgresql.org>
Subject: Re: bogus psql "could not save history file[...]" message in 9.3.6
Date: Fri, 13 Mar 2015 22:02:17 -0400
Message-ID: <C62C1935-E674-4828-BA68-6C599263C600@pgexperts.com> (raw)
In-Reply-To: <31313.1426298202@sss.pgh.pa.us>
References: <CAKFQuwZx4E53BHBUFseoawEtwyrmDhY5ksvzhYtkHEoNd3kc1Q@mail.gmail.com>
<31313.1426298202@sss.pgh.pa.us>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>
> On Mar 13, 2015, at 9:56 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>
> "David G. Johnston" <david.g.johnston@gmail.com> writes:
>>> \q # 'could not save history to file "/var/lib/postgresql/.psql_history":
>> No such file or directory' !!!
>
> BTW, I poked around in the libedit sources and noted that it will call
> wctomb() during write_history(), assuming it's configured to support wide
> characters. Working hypothesis is that wctomb() is trying to read some
> locale configuration file and not finding it, which it's probably okay
> with, but our is-errno-set check is unhappy later. This behavior might
> well vary depending on what locale environment you have set.
>
> strace'ing psql while it exits might be informative.
Here you go:
Process 3951 attached
read(0, "\4", 1) = 1
ioctl(0, SNDCTL_TMR_TIMEBASE or SNDRV_TIMER_IOCTL_NEXT_DEVICE or TCGETS, {B38400 opost isig -icanon -echo ...}) = 0
ioctl(0, SNDCTL_TMR_STOP or SNDRV_TIMER_IOCTL_GINFO or TCSETSW, {B38400 opost isig icanon echo ...}) = 0
ioctl(0, SNDCTL_TMR_TIMEBASE or SNDRV_TIMER_IOCTL_NEXT_DEVICE or TCGETS, {B38400 opost isig icanon echo ...}) = 0
rt_sigaction(SIGINT, {0x7f5798b08730, [], SA_RESTORER|SA_RESTART, 0x7f5797c3dff0}, {0x7f57986b0ab0, [], SA_RESTORER, 0x7f5797c3dff0}, 8) = 0
rt_sigaction(SIGTERM, {SIG_DFL, [], SA_RESTORER, 0x7f5797c3dff0}, {0x7f57986b0ab0, [], SA_RESTORER, 0x7f5797c3dff0}, 8) = 0
rt_sigaction(SIGHUP, {SIG_DFL, [], SA_RESTORER, 0x7f5797c3dff0}, {0x7f57986b0ab0, [], SA_RESTORER, 0x7f5797c3dff0}, 8) = 0
rt_sigaction(SIGQUIT, {SIG_DFL, [], SA_RESTORER, 0x7f5797c3dff0}, {0x7f57986b0ab0, [], SA_RESTORER, 0x7f5797c3dff0}, 8) = 0
rt_sigaction(SIGALRM, {SIG_DFL, [], SA_RESTORER, 0x7f5797c3dff0}, {0x7f57986b0ab0, [], SA_RESTORER, 0x7f5797c3dff0}, 8) = 0
rt_sigaction(SIGTSTP, {SIG_DFL, [], SA_RESTORER, 0x7f5797c3dff0}, {0x7f57986b0ab0, [], SA_RESTORER, 0x7f5797c3dff0}, 8) = 0
rt_sigaction(SIGTTOU, {SIG_DFL, [], SA_RESTORER, 0x7f5797c3dff0}, {0x7f57986b0ab0, [], SA_RESTORER, 0x7f5797c3dff0}, 8) = 0
rt_sigaction(SIGTTIN, {SIG_DFL, [], SA_RESTORER, 0x7f5797c3dff0}, {0x7f57986b0ab0, [], SA_RESTORER, 0x7f5797c3dff0}, 8) = 0
rt_sigaction(SIGWINCH, {SIG_DFL, [], SA_RESTORER, 0x7f5797c3dff0}, {0x7f57986b0090, [], SA_RESTORER|SA_RESTART, 0x7f5797c3dff0}, 8) = 0
write(1, "\\q\n", 3) = 3
sendto(3, "X\0\0\0\4", 5, MSG_NOSIGNAL, NULL, 0) = 5
close(3) = 0
rt_sigaction(SIGPIPE, {SIG_DFL, [], SA_RESTORER|SA_RESTART, 0x7f5797c3dff0}, {SIG_DFL, [], 0}, 8) = 0
rename("/var/lib/postgresql/.psql_history", "/var/lib/postgresql/.psql_history-") = -1 ENOENT (No such file or directory)
open("/var/lib/postgresql/.psql_history", O_WRONLY|O_CREAT|O_TRUNC, 0600) = 3
write(3, "select 1;\n", 10) = 10
close(3) = 0
unlink("/var/lib/postgresql/.psql_history-") = -1 ENOENT (No such file or directory)
open("/usr/share/locale/en_US.UTF-8/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/locale/en_US.utf8/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/locale/en_US/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/locale/en.UTF-8/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/locale/en.utf8/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/locale/en/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/locale-langpack/en_US.UTF-8/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/locale-langpack/en_US.utf8/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/locale-langpack/en_US/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/locale-langpack/en.UTF-8/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/locale-langpack/en.utf8/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/locale-langpack/en/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
write(2, "could not save history to file \""..., 94) = 94
exit_group(0) = ?
+++ exited with 0 +++
--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs
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 from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-bugs@postgresql.org
Cc: jeff@pgexperts.com, tgl@sss.pgh.pa.us, david.g.johnston@gmail.com
Subject: Re: bogus psql "could not save history file[...]" message in 9.3.6
In-Reply-To: <C62C1935-E674-4828-BA68-6C599263C600@pgexperts.com>
References: <CAKFQuwZx4E53BHBUFseoawEtwyrmDhY5ksvzhYtkHEoNd3kc1Q@mail.gmail.com> <31313.1426298202@sss.pgh.pa.us> <C62C1935-E674-4828-BA68-6C599263C600@pgexperts.com>
* 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