PGSYSCONFDIR?

From: John Sutton <johnericsutton(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: PGSYSCONFDIR?
Date: 2014-01-14 18:58:31
Message-ID: D098FAEE-1EB3-4972-933D-ED6A4BD33369@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi there

Having spent about 2 hours trying to solve a simple problem, I think it might be worthwhile to record my efforts. Perhaps someone can point out how extremely silly I have been… or is the documentation lacking?

My original question was: where is the system-wide psqlrc file located?

Some material on the web suggests that this is ~postgres/.psqlrc but this not true, this is just the postgres user’s user-specific config file.

I tried putting it alongside pg_hba.conf etc but that didn’t work.

The psqlrc.sample file contains the wording “Copy this to your sysconf directory (typically /usr/local/pqsql/etc) …” but that directory doesn’t exist on either of my target systems! (I’m using postgres 9.1 on Ubuntu and Mac OS X.)

As a last resort (which surely shouldn’t be necessary) on the Ubuntu system I did:

strings /usr/bin/psql | grep -i sysconf

$ENV{'PGSYSCONFDIR'} = '/etc/postgresql-common' if !$ENV{'PGSYSCONFDIR’};

So that’s where it needs to be: /etc/postgresql-common/psqlrc

I’ve still no clue for Mac OS X however, since the same trick only finds a placeholder :( :

strings /Applications/Postgres.app/Contents/MacOS/bin/psql | grep -i sysconf

PGSYSCONFDIR
PGSYSCONFDIR=%s

Hope this saves somebody some time.

--
John Sutton

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Alvaro Herrera 2014-01-14 19:10:05 Re: PGSYSCONFDIR?
Previous Message Zev Benjamin 2014-01-14 18:07:24 HeadlineWordEntry bit fields