| From: | Ozan Kahramanogullari <ozan(dot)kah(at)gmail(dot)com> | 
|---|---|
| To: | tgl(at)sss(dot)pgh(dot)pa(dot)us | 
| Cc: | Andrej Ricnik <andrej(dot)groups(at)gmail(dot)com>, Jeff Frost <jeff(dot)frost(at)gmail(dot)com>, pgsql-novice(at)postgresql(dot)org | 
| Subject: | Re: psql on Mac | 
| Date: | 2018-10-24 09:30:36 | 
| Message-ID: | CAPiqqLnsgE+CiRAsdtNHiUpODPi1WSKH2QxE5irDbTJwhn_O=w@mail.gmail.com | 
| Views: | Whole Thread | Raw Message | Download mbox | Resend email | 
| Thread: | |
| Lists: | pgsql-bugs pgsql-novice | 
Hi Tom, Thank you! I copied and pasted the content of your pg_hba file as
it is. Then, I rebooted my computer.  There is only one installation of
postgreSQL, so there is only such file. It is in the folder
"/Library/PostgreSQL/10/data".
Sorry, but none of this brings me close to the what I see in the tutorial.
Cheers,
Ozan
On Wed, 24 Oct 2018 at 11:08, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> Ozan Kahramanogullari <ozan(dot)kah(at)gmail(dot)com> writes:
> > Thank you, Andrej. I tried the instructions in this website. However,
> this
> > did not provide the desired outcome. I am pasting the command line
> > below.Also, the command "psql -h localhost" did not work.
>
> > XXX:src3 ozan$ psql -h localhost
> > Password:
> > psql: FATAL:  password authentication failed for user "ozan"
>
> This definitely indicates that the server thinks you specified password
> auth (of one flavor or another).  Now this:
>
> > local   all             all                                     trust
>
> looks like it ought to let everything in without a password, but the
> problem is that "local" only means Unix-socket connections.  So it
> should apply when you say "psql" or "psql -U somebody", but it does
> *not* apply to TCP connections which is what you get with "-h localhost".
> What you really want, if you just want to let in all same-machine
> connections indiscriminately, is this:
>
> # "local" is for Unix domain socket connections only
> local   all             all                                     trust
> # IPv4 local connections:
> host    all             all             127.0.0.1/32            trust
> # IPv6 local connections:
> host    all             all             ::1/128                 trust
> # Allow replication connections from localhost, by a user with the
> # replication privilege.
> local   replication     all                                     trust
> host    replication     all             127.0.0.1/32            trust
> host    replication     all             ::1/128                 trust
>
> (copied from what I've got on my Mac).
>
> > local   postgres        postgres                                trust
> > local   all             postgres                                trust
>
> These lines are pretty pointless given the previous "local all all"
> line; that one will capture any connections that these could match.
>
> > XXX:src3 ozan$ psql -U ozan
> > Password for user ozan:
> > psql: FATAL:  password authentication failed for user "ozan"
>
> This, on the other hand, suggests that you've got still more problems;
> this should have matched the "local all all" line, but obviously it
> did not.  Somewhere the server is finding a pg_hba.conf line that is
> telling it to use password authentication.  Some possibilities:
>
> 1. You aren't editing the right pg_hba.conf file.  ("show hba_file"
> should confirm where the server thinks that file is.  In PG v10 or
> newer, the pg_hba_file_rules view is also helpful.)
>
> 2. You stuck the lines you're showing us at the bottom of an existing
> pg_hba.conf file, not paying attention to earlier lines that would
> control what the server does.  The rule is that the first entry in
> pg_hba.conf that matches the connection request is what's used.  So
> be sure to delete or comment out rules you don't want.
>
> 3. You edited the right file, but didn't restart or reload the server
> afterwards, so it's still using old data.
>
>                         regards, tom lane
>
| From | Date | Subject | |
|---|---|---|---|
| Next Message | 张心灵 | 2018-10-24 09:37:01 | postgres 11.0 partition table works unexpected in update | 
| Previous Message | Tom Lane | 2018-10-24 09:08:52 | Re: psql on Mac | 
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Tom Lane | 2018-10-24 09:42:23 | Re: psql on Mac | 
| Previous Message | Tom Lane | 2018-10-24 09:08:52 | Re: psql on Mac |