Two round for Client Authentication - Mailing list pgsql-hackers

From Yinjie Lin
Subject Two round for Client Authentication
Date
Msg-id CA+zFF0dy3Z8SA2f=ZghAiGT_DjK0eeG7H8xZegORxvbbxerH5Q@mail.gmail.com
Whole thread Raw
Responses Re: Two round for Client Authentication
Re: Two round for Client Authentication
List pgsql-hackers
Hello everyone.

I am a newcomer to PostgreSQL, and I don't know if it is proper to post my question here, but I really need some help.

Currently I am reading and testing code about Client Authentication, but I find that there are two progresses forked if I login using psql, while only one progress is forked if using pgAdmin.

My pg_hba.conf is as follows:
local  all  all                               md5
host  all  all  192.168.64.56/32  md5

If I login with psql, the following stack is called twice:
    ServerLoop
    BackendStartup
    BackendRun
    PostgresMain
    InitPostgres
    PerformAuthentication
    ClientAuthentication

In the first round, the variable `status` in function ClientAuthentication() is always STATUS_EOF (at least in my test). In the second round, `status` seems to be what should be expected: STATUS_OK for correct password, STATUS_ERROR for wrong password, and STATUS_EOF for empty password.

Why are there two such progresses forked? I think one round should be enough, like when using pgAdmin.

Besides, I find it hard to debug the ServerLoop() stack, compared with the backend progress for query, because there are two many subprogresses and signals. It would be of great help if anyone could give me some instructions on how to learn to debug postmaster using gdb.

Thanks in advance!

Best Regards


pgsql-hackers by date:

Previous
From: Amit Kapila
Date:
Subject: Re: WAL prefetch
Next
From: Amit Langote
Date:
Subject: Re: Partitioning with temp tables is broken