Обсуждение: "save history" problem

Поиск
Список
Период
Сортировка

"save history" problem

От
"David F. Johnson"
Дата:
Greetings.

Any ideas on how to resolve this problem:

==========

Welcome to psql 8.1.3, the PostgreSQL interactive terminal.

Type:  \copyright for distribution terms
       \h for help with SQL commands
       \? for help with psql commands
       \g or terminate with semicolon to execute query
       \q to quit

test=# \q
could not save history to file "/usr/local/pgsql//.psql_history": Permission
denied

==========

Other installations of stable releases of 8.x.x did not have this problem,
though I'm just now running it under Mac OS X Tiger (10.4.6).  I'm guessing
it's a Tiger issue but I don't know what to do about it.

That said, shouldn't

    /usr/local/pgsql//.psql_history

be

    /usr/local/pgsql/.psql_history

instead?  I gave up trying to fix it using a .psqlrc file.

Thanks,
David

PS Thank you SO MUCH for such an absolutely incredible database!



Re: "save history" problem

От
Martijn van Oosterhout
Дата:
On Sun, Apr 23, 2006 at 09:33:40PM -0400, David F. Johnson wrote:
> Greetings.
>
> Any ideas on how to resolve this problem:

<snip>

> test=# \q
> could not save history to file "/usr/local/pgsql//.psql_history": Permission
> denied

I don't know about the platform, but shouldn't that refer to your home
directory?

> Other installations of stable releases of 8.x.x did not have this problem,
> though I'm just now running it under Mac OS X Tiger (10.4.6).  I'm guessing
> it's a Tiger issue but I don't know what to do about it.

Something like: \set HISTFILE 'blah' should do it, check the docs.

> That said, shouldn't
>     /usr/local/pgsql//.psql_history
> be
>     /usr/local/pgsql/.psql_history

There's no difference (semantically) between the two...

Have a nice day,
--
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> From each according to his ability. To each according to his ability to litigate.

Вложения

Re: "save history" problem

От
Jerry LeVan
Дата:
David,

It appears that the problem is related to the
fact that MacOSX does not really use the libreadline
(checks and you will see that it is a symlink to
libedit.)

I asked this question a year or so ago and Tom
Lane said that when the history file was closed
that the libedit did not return the right  status
code.

I got rid of the error message by changing the source
to ignore the return code...

Currently I simply ignore the error message :) and
use tools that have reduced my usage of psql to
a bare minimum. ( http://homepage.mac.com/levanj )

Jerry



Re: "save history" problem

От
"David F. Johnson"
Дата:
Hi Martijn.

Thanks for the tip on there being no real difference in the two paths (i.e.,
I'm not a Unix guy).

Unfortunately, as I said in my original post, using the .psqlrc option to
set the HISTFILE to the user directory didn't work either.

After changing ownership of the /usr/local/pgsql/ to the postgres user, the
history file mechanism works (i.e., the history is saved in the
.psql_history file), but this message is reported:

could not save history to file "/usr/local/pgsql//.psql_history": Unknown
error: 0

There's no .psqlrc file so it's just using the default.  Since the message
is benign I'll just ignore it (like Jerry Levan does :)

Thanks,
David

On 4/24/06 1:59 PM, "Martijn van Oosterhout" <kleptog@svana.org> wrote:

> On Sun, Apr 23, 2006 at 09:33:40PM -0400, David F. Johnson wrote:
>> Greetings.
>>
>> Any ideas on how to resolve this problem:
>
> <snip>
>
>> test=# \q
>> could not save history to file "/usr/local/pgsql//.psql_history": Permission
>> denied
>
> I don't know about the platform, but shouldn't that refer to your home
> directory?
>
>> Other installations of stable releases of 8.x.x did not have this problem,
>> though I'm just now running it under Mac OS X Tiger (10.4.6).  I'm guessing
>> it's a Tiger issue but I don't know what to do about it.
>
> Something like: \set HISTFILE 'blah' should do it, check the docs.
>
>> That said, shouldn't
>>     /usr/local/pgsql//.psql_history
>> be
>>     /usr/local/pgsql/.psql_history
>
> There's no difference (semantically) between the two...
>
> Have a nice day,



Re: "save history" problem

От
Michael Talbot-Wilson
Дата:
On Mon, 24 Apr 2006, David F. Johnson wrote:

> ...
> could not save history to file "/usr/local/pgsql//.psql_history": Unknown
> error: 0
> ...
>>> though I'm just now running it under Mac OS X Tiger (10.4.6).  I'm guessing
>>> it's a Tiger issue but I don't know what to do about it.

This was answered by Tom Lane in the NOVICE list recently.  The
problem is that X.4 uses a fake readline library.  You need to
download and install the real GNU Readline, having eliminated the
readline > whatever symlink.  Then recompile and reinstall
PostgreSQL.