Re: Where is pg_hba.conf

From: Igor Korot <ikorot01(at)gmail(dot)com>
To: armand pirvu <armand(dot)pirvu(at)gmail(dot)com>
Cc: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: Where is pg_hba.conf
Date: 2017-08-13 14:32:32
Message-ID: CA+FnnTx4fiTyc3Ag9g5n2LqG+DvF6DeEC6UMVsrRkM6mTMJSEg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi, armand,

On Sun, Aug 13, 2017 at 10:12 AM, armand pirvu <armand(dot)pirvu(at)gmail(dot)com> wrote:
> Normally should reside in the data dir. My case below
>
> armandps-MacBook-Air:~ armandp$ ps -fu postgres |grep data
> 502 29591 1 0 Thu09PM ?? 0:01.63
> /Library/PostgreSQL/9.6/bin/postgres -D /Library/PostgreSQL/9.6/data
>
> armandps-MacBook-Air:~ armandp$ ls -l
> /Library/PostgreSQL/9.6/data/pg_hba.conf
> ls: /Library/PostgreSQL/9.6/data/pg_hba.conf: Permission denied
> armandps-MacBook-Air:~ armandp$ sudo ls -l
> /Library/PostgreSQL/9.6/data/pg_hba.conf
> -rw------- 1 postgres daemon 4248 Aug 10 21:17
> /Library/PostgreSQL/9.6/data/pg_hba.conf
>
> Is it possible that global search fails from a permission error ?

MyMac:/ igorkorot$ ps -fu postgres |grep data
502 77 1 0 11:38PM ?? 0:00.45
/Library/PostgreSQL/9.1/bin/postmaster -D/Library/PostgreSQL/9.1/data
502 1733 243 0 10:42AM ?? 0:00.05
/System/Library/Frameworks/CoreServices.framework/Frameworks/Metadata.framework/Versions/A/Support/mdworker
-s mdworker -c MDSImporterWorker -m com.apple.mdworker.shared
MyMac:/ igorkorot$ ls -la /Library/PostgreSQL/9.1/data/
ls: : Permission denied
MyMac:/ igorkorot$ su
Password:
sh-3.2# ls -la /Library/PostgreSQL/9.1/data/
total 88
drwx------ 20 postgres daemon 680 Aug 12 23:38 .
drwxr-xr-x 16 root daemon 544 Dec 4 2016 ..
-rw------- 1 postgres daemon 4 Dec 4 2016 PG_VERSION
drwx------ 7 postgres daemon 238 Dec 9 2016 base
drwx------ 42 postgres daemon 1428 Aug 12 23:39 global
drwx------ 3 postgres daemon 102 Dec 4 2016 pg_clog
-rw------- 1 postgres daemon 4222 Dec 4 2016 pg_hba.conf
-rw------- 1 postgres daemon 1636 Dec 4 2016 pg_ident.conf
drwxr-xr-x 204 postgres daemon 6936 Aug 13 00:00 pg_log
drwx------ 4 postgres daemon 136 Dec 4 2016 pg_multixact
drwx------ 3 postgres daemon 102 Aug 12 23:38 pg_notify
drwx------ 2 postgres daemon 68 Dec 4 2016 pg_serial
drwx------ 3 postgres daemon 102 Aug 13 10:43 pg_stat_tmp
drwx------ 3 postgres daemon 102 Dec 4 2016 pg_subtrans
drwx------ 2 postgres daemon 68 Dec 4 2016 pg_tblspc
drwx------ 2 postgres daemon 68 Dec 4 2016 pg_twophase
drwx------ 5 postgres daemon 170 Dec 11 2016 pg_xlog
-rw-r--r-- 1 postgres daemon 19162 Dec 4 2016 postgresql.conf
-rw------- 1 postgres daemon 70 Aug 12 23:38 postmaster.opts
-rw------- 1 postgres daemon 75 Aug 12 23:38 postmaster.pid
sh-3.2#

Apparently it looks like the failure is from the permission.

So how do I enable it? Or it has to stay for "root" only?

Thank you.

>
> Hope this helps
>
>
>
> On Aug 13, 2017, at 9:00 AM, Igor Korot <ikorot01(at)gmail(dot)com> wrote:
>
> Hi,
> I have a Mac with OSX 10.8 installed. It has Postgre 9.1.
> According to
> https://www.postgresql.org/docs/9.1/static/auth-pg-hba-conf.html
> and
> http://www.thegeekstuff.com/2014/02/enable-remote-postgresql-connection/?utm_source=tuicool
> I need to modify the pg_hba.conf file to get access to the DB
> remotely.
>
> However, I can't find this file anywhere on the system.
> I am able to connec to the server locally with psql. I can also
> connect to the server
> from the ODBC driver from my program. However doing a global search I
> can't find that file.
>
> Can someone please help?
>
> Thank you.
>
>
> --
> Sent via pgsql-general mailing list (pgsql-general(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-general
>
>

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Christoph Berg 2017-08-13 14:37:43 Re: Where is pg_hba.conf
Previous Message Igor Korot 2017-08-13 14:27:41 Re: Where is pg_hba.conf