Re: bogus psql "could not save history file[...]" message in 9.3.6

From: Jeff Frost <jeff(at)pgexperts(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>, "pgsql-bugs(at)postgresql(dot)org" <pgsql-bugs(at)postgresql(dot)org>
Subject: Re: bogus psql "could not save history file[...]" message in 9.3.6
Date: 2015-03-14 02:02:17
Message-ID: C62C1935-E674-4828-BA68-6C599263C600@pgexperts.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs


> On Mar 13, 2015, at 9:56 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>
> "David G. Johnston" <david(dot)g(dot)johnston(at)gmail(dot)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 +++

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2015-03-14 02:22:28 Re: bogus psql "could not save history file[...]" message in 9.3.6
Previous Message Tom Lane 2015-03-14 01:56:42 Re: bogus psql "could not save history file[...]" message in 9.3.6