pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Steve Baldwin <steve.baldwin@gmail.com>
Cc: pgsql-generallists.postgresql.org <pgsql-general@lists.postgresql.org>
Subject: Re: psql trying twice to connect to local DB
Date: Sat, 07 Oct 2023 19:14:46 -0400
Message-ID: <3202243.1696720486@sss.pgh.pa.us> (raw)
In-Reply-To: <CAKE1AiZLfCmvpb5EspiKn0AHRt7KBLgcNmG9kH3CQcEAxHcV2w@mail.gmail.com>
References: <CAKE1AiZLfCmvpb5EspiKn0AHRt7KBLgcNmG9kH3CQcEAxHcV2w@mail.gmail.com>

Steve Baldwin <steve.baldwin@gmail.com> writes:
> If I make a connection to that DB from most clients I see log entries like
> this:
> ...
> If however I use psql I see two connection log entries - sometimes almost a
> second apart. For example:

These log entries show that you're using password-based authentication.
I believe what is happening is that psql tries to connect, discovers
that it needs a password, and then tries again after it's got a
password.  The delay would correspond to the time for you to type
your password (I take it you're a fast typist).

If you don't like the extra log entries, there's a command-line
switch that forces psql to prompt for password before connecting
the first time.  Of course, that might result in prompting for
a password that's not really needed.

			regards, tom lane





view thread (4+ messages)  latest in thread

Message-ID: <3202243.1696720486@sss.pgh.pa.us>
Permalink:  ../3202243.1696720486@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/3202243.1696720486@sss.pgh.pa.us

 · 

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: tgl@sss.pgh.pa.us, steve.baldwin@gmail.com
  Subject: Re: psql trying twice to connect to local DB
  In-Reply-To: <3202243.1696720486@sss.pgh.pa.us>
  References: <CAKE1AiZLfCmvpb5EspiKn0AHRt7KBLgcNmG9kH3CQcEAxHcV2w@mail.gmail.com> <3202243.1696720486@sss.pgh.pa.us>

* 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