Search Postgresql Archives

Re: ~/.psqlrc file is ignored

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi David: I see what you are saying; sorry for the confusion. This is how postgres operates on my system:

[victoria@victoria ~]$ echo $HOME
  /home/victoria

[victoria@victoria ~]$ which postgres
  /usr/bin/postgres

[victoria@victoria ~]$ postgres
  postgres does not know where to find the server configuration file.
  You must specify the --config-file or -D invocation option or set the PGDATA environment variable.

[victoria@victoria ~]$ psql
  psql: FATAL:  database "victoria" does not exist

[victoria@victoria ~]$ sudo -u postgres -i

[postgres@victoria ~]$ echo $HOME
  /var/lib/postgres

[postgres@victoria ~]$ psql
  psql (9.6.3)
  Type "help" for help.

postgres=# \q

[postgres@victoria ~]$ exit
  logout

[victoria@victoria ~]$

... That postgres had a different $HOME environment than mine was not apparent to me, when I posted this question.

> What does "your" ~/.psqlrc have to do with any of this?  If you are
> executing psql while masquarding at the postgres user its the postgres
> user's​ ~/.psqlrc file that will be looked for.

> Typically one doesn't execute psql as the postgres user.  They configure
> the system so that they can execute psql as a regular user.  You should
> probably do that and then everything should work like you are thinking.


View this message in context: Re: ~/.psqlrc file is ignored
Sent from the PostgreSQL - general mailing list archive at Nabble.com.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]

  Powered by Linux