Bug 168802

Summary: duplicate log entry when logging connections
Product: [Fedora] Fedora Reporter: Andrew Dunstan <andrew>
Component: postgresqlAssignee: Tom Lane <tgl>
Status: CLOSED NOTABUG QA Contact: David Lawrence <dkl>
Severity: medium Docs Contact:
Priority: medium    
Version: 4CC: hhorak
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2005-09-22 03:37:37 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
pg_hba.conf
none
postgresql.conf none

Description Andrew Dunstan 2005-09-20 13:25:56 UTC
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 21:10:57 UTC
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 21:51:50 UTC
Created attachment 119108 [details]
pg_hba.conf

Comment 3 Andrew Dunstan 2005-09-21 21:52:45 UTC
Created attachment 119109 [details]
postgresql.conf

Comment 4 Andrew Dunstan 2005-09-21 22:19:19 UTC
(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-22 02:36:09 UTC
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-22 03:04:31 UTC
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-22 03:37:37 UTC
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.