Re: ~/.psqlrc file is ignored

From: vstuart <mail(at)VictoriasJourney(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: ~/.psqlrc file is ignored
Date: 2017-07-19 18:49:09
Message-ID: 20170719114843.72233f7e@VictoriasJourney.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi Thom: thank you for your reply; I can't figure this one out! Per your reply:

[victoria(at)victoria ~]$ pg
[sudo -u postgres -i]
[sudo] password for victoria:

[postgres(at)victoria ~]$ psql -a
psql (9.6.3)
Type "help" for help.

postgres=# \q

[postgres(at)victoria ~]$ psql -af ~/.psqlrc
/var/lib/postgres/.psqlrc: No such file or directory

[postgres(at)victoria ~]$ exit
logout

[victoria(at)victoria ~]$

So, it appears that postgres is looking for the .psqlrc file there (does not exist), but ignoring my ~/.psqlrc file, right?

Edit: from that, it appears that postgres thinks that my home directory is /var/lib/postgres/. ... Confirmed:

[postgres(at)victoria ~]$ echo $HOME
/var/lib/postgres

As a simple solution, I can sudo symlink MY ~/.psqlrc to that directory (/var/...; changing ownership also to postgres), but there appears to be some underlying issue, as Pg should find ~/.psqlrc, correct?

FYI, I installed postgresql (Arch Linux) using the "pacman" package manager; the only significant change I made is to define a custom data directory, on my home partition.

----------------------------------------
From: "Thom Brown-2 [via PostgreSQL]" <ml+s1045698n5971968h76(at)n3(dot)nabble(dot)com>
Subject: Re: ~/.psqlrc file is ignored
Date: Wed, 19 Jul 2017 11:31:49 -0700 (MST)

Do you get anything with "psql -a"?

If not, what do you get when you use "psql -af ~/.psqlrc" ?

Thom

--
View this message in context: http://www.postgresql-archive.org/psqlrc-file-is-ignored-tp5971773p5971973.html
Sent from the PostgreSQL - general mailing list archive at Nabble.com.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message David G. Johnston 2017-07-19 19:02:52 Re: ~/.psqlrc file is ignored
Previous Message Tom Lane 2017-07-19 18:42:07 Re: UPDATE column without FK fires other FK triggers constraint check