pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: pan snowave <windxp@live.cn>
To: David G. Johnston <david.g.johnston@gmail.com>
Cc: Alban Hertroys <haramrae@gmail.com>
Cc: pgsql-general@lists.postgresql.org <pgsql-general@lists.postgresql.org>
Subject: 回复: ident auth does not works as usual
Date: Tue, 19 Sep 2023 03:46:07 +0000
Message-ID: <OS3P286MB1933DC61D588D95C768F1F2CD3FAA@OS3P286MB1933.JPNP286.PROD.OUTLOOK.COM> (raw)
In-Reply-To: <CAKFQuwa4WC6LUXwRxxAkxAyqPOeLhxKBQfDkeUBxgkDZi++urw@mail.gmail.com>
References: <OS3P286MB1933B415C59DC5C600DC0983D3E2A@OS3P286MB1933.JPNP286.PROD.OUTLOOK.COM>
	<B8F2D70E-A224-409A-A8DA-330552FBF962@gmail.com>
	<OS3P286MB193327FB105CD72F695D0946D3E1A@OS3P286MB1933.JPNP286.PROD.OUTLOOK.COM>
	<CAKFQuwa4WC6LUXwRxxAkxAyqPOeLhxKBQfDkeUBxgkDZi++urw@mail.gmail.com>

HI

I've got the  right meanng of pg_hba.conf and pg_ident.conf.

My previous understanding was incorrect. I thought pgserver would automatically handle the conversion between OS users and PostgreSQL roles.

Thanks all.


________________________________
发件人: David G. Johnston <david.g.johnston@gmail.com>
发送时间: 2023年8月28日 14:44
收件人: pan snowave <windxp@live.cn>
抄送: Alban Hertroys <haramrae@gmail.com>; pgsql-general@lists.postgresql.org <pgsql-general@lists.postgresql.org>
主题: Re: ident auth does not works as usual

On Mon, Aug 28, 2023 at 7:34 AM pan snowave <windxp@live.cn<mailto:windxp@live.cn>> wrote:
But when i connect to psserver by using os user root
/usr/local/pgsql/bin/psql   -p5432 -d db1     -h127.0.0.1

If you want to login as the cce role add " -U cce " to your command line (or one of the various other ways you can specify a db role name via the cli or libpq)

psql -U cce -h 127.0.0.1 -d db1

Keep in mind you could very well have two lines in your pg_ident.conf file:

test root cce
test root ddf

David J.


view thread (6+ messages)

Message-ID: <OS3P286MB1933DC61D588D95C768F1F2CD3FAA@OS3P286MB1933.JPNP286.PROD.OUTLOOK.COM>
Permalink:  ../OS3P286MB1933DC61D588D95C768F1F2CD3FAA@OS3P286MB1933.JPNP286.PROD.OUTLOOK.COM/
Also on:    postgresql.org/message-id/OS3P286MB1933DC61D588D95C768F1F2CD3FAA@OS3P286MB1933.JPNP286.PROD.OUTLOOK.COM

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: windxp@live.cn, david.g.johnston@gmail.com, haramrae@gmail.com
  Subject: Re: 回复: ident auth does not works as usual
  In-Reply-To: <OS3P286MB1933DC61D588D95C768F1F2CD3FAA@OS3P286MB1933.JPNP286.PROD.OUTLOOK.COM>
  References: <OS3P286MB1933B415C59DC5C600DC0983D3E2A@OS3P286MB1933.JPNP286.PROD.OUTLOOK.COM> <B8F2D70E-A224-409A-A8DA-330552FBF962@gmail.com> <OS3P286MB193327FB105CD72F695D0946D3E1A@OS3P286MB1933.JPNP286.PROD.OUTLOOK.COM> <CAKFQuwa4WC6LUXwRxxAkxAyqPOeLhxKBQfDkeUBxgkDZi++urw@mail.gmail.com> <OS3P286MB1933DC61D588D95C768F1F2CD3FAA@OS3P286MB1933.JPNP286.PROD.OUTLOOK.COM>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox