Bug 168802 - duplicate log entry when logging connections
duplicate log entry when logging connections
Status: CLOSED NOTABUG
Product: Fedora
Classification: Fedora
Component: postgresql (Show other bugs)
4
All Linux
medium Severity medium
: ---
: ---
Assigned To: Tom Lane
David Lawrence
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2005-09-20 09:25 EDT by Andrew Dunstan
Modified: 2013-07-02 23:06 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2005-09-21 23:37:37 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)
pg_hba.conf (3.32 KB, text/plain)
2005-09-21 17:51 EDT, Andrew Dunstan
no flags Details
postgresql.conf (10.77 KB, text/plain)
2005-09-21 17:52 EDT, Andrew Dunstan
no flags Details

  None (edit)
Description Andrew Dunstan 2005-09-20 09:25:56 EDT
Description of problem:

log_connections config setting causes two log entries rather than one

Version-Release number of selected component (if applicable):

8.0.3-1

How reproducible:

constant

Steps to Reproduce:
1. in postgresql.conf, log_connections = 'true'
2. start server
3. as user postgres, connect via "psql template1", disconnect
  
Actual results:

2 lines in log file /var/lib/pgsql/data/pg_log/postgresql-Tue.log:

LOG:  connection received: host=[local] port=
LOG:  connection received: host=[local] port=

Expected results:

only one line

Additional info:

does not seem to occur with postgres build from vanilla postgresql sources for
8.0.3.
Comment 1 Tom Lane 2005-09-21 17:10:57 EDT
I can't replicate this on my own FC4 machine, using either my own build of the RPMS or RPMS downloaded 
via "yum install".  Is it possible you've got a corrupted download?  What other nondefault settings do you 
have besides log_connections (contents of pg_hba.conf could be significant for instance)?  Is the platform 
x86 or something else?  Are you up-to-date on the rest of FC4?
Comment 2 Andrew Dunstan 2005-09-21 17:51:50 EDT
Created attachment 119108 [details]
pg_hba.conf
Comment 3 Andrew Dunstan 2005-09-21 17:52:45 EDT
Created attachment 119109 [details]
postgresql.conf
Comment 4 Andrew Dunstan 2005-09-21 18:19:19 EDT
(In reply to comment #1)
> I can't replicate this on my own FC4 machine, using either my own build of the
RPMS or RPMS downloaded 
> via "yum install".  Is it possible you've got a corrupted download?  What
other nondefault settings do you 
> have besides log_connections (contents of pg_hba.conf could be significant for
instance)? 

Config files attached. rpm --verify shows clean. I have verified that they are
the Fedora RPMs and not rogues.

I do have md5 turned on for all connections. 


... that set me thinking ...

that makes the difference, my experiments show. In fact, I have now confirmed
this with vanilla postgres sources, so it appears not the be a Fedora-specific
bug after all.

> Is the platform 
> x86 or something else?  


P4 HP zv5000 laptop.


> Are you up-to-date on the rest of FC4?

yes
Comment 5 Tom Lane 2005-09-21 22:36:09 EDT
md5 password eh?  I believe that libpq is written to not prompt the user for a password until it's tried and 
failed to establish a connection without one.  It's possible that that logic also applies to, say, pulling a 
password from ~/.pgpass.  Where is your password coming from exactly?
Comment 6 Andrew Dunstan 2005-09-21 23:04:31 EDT
From the kbd. I see what's happening now.

You're right, if there's a pgpass file, or I give psql the -W flag this does not
occur. I had assumed this was handled at the protocol level rather than having
it fail and try again. I guess the plus side is that most apps and libraries
will supply a password as a connection parameter.

It's damned confusing, though, to say the least.
Comment 7 Tom Lane 2005-09-21 23:37:37 EDT
OK.  I'm going to close this entry NOTABUG, because from Red Hat's perspective it isn't one: the code is 
operating as designed by the upstream developers.  But feel free to take up a discussion on pgsql-hackers 
about whether this can be done better.

Note You need to log in before you can comment on or make changes to this bug.