logging blemishes

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: logging blemishes
Date: 2005-09-19 23:32:25
Message-ID: 432F4A89.9020103@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


While preparing for a presentation, I noticed some mildly ugly effects
with log_line_prefix during session startup if log_connections is turned on.

Example (log_line_prefix = '%t %q%u(at)%d %r %p %c:%l'):

2005-09-19 19:16:39 EDT [unknown](at)[unknown] 6541 432f46d7.198d:1 LOG:
connection received: host=[local] port=
2005-09-19 19:16:42 EDT [unknown](at)[unknown] 6543 432f46da.198f:1 LOG:
connection received: host=[local] port=
2005-09-19 19:16:42 EDT postgres(at)template1 [local] 6543 432f46da.198f:2
LOG: connection authorized: user=postgres database=template1
2005-09-19 19:16:44 EDT postgres(at)template1 [local] 6543 432f46da.198f:3
LOG: disconnection: session time: 0:00:01.95 user=postgres
database=template1 host=[local] port=

I'm also unclear why we get two lines at the start of each connection -
that seems like a bug, or is it due to some sort of protocol
negotiation. This is a fresh FC4 machine with only pg 8.0.3 ever installed.

Anyway, currently, we test for "stop producing output here" with the
following code in elog.c:

case 'q':
/* in postmaster and friends, stop if %q is seen */
/* in a backend, just ignore */
if (MyProcPort == NULL)
i = format_len;
break;

I'm wondering if we should extend that test slightly, to something like

if (MyProcPort == NULL || MyProcPort->username == NULL
|| *(MyProcPort->username) == '\0')

Thoughts?

cheers

andrew

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Mark Dilger 2005-09-20 00:47:39 Re: 64-bit API for large objects
Previous Message Bruce Momjian 2005-09-19 22:35:42 Re: Spinlocks, yet again: analysis and proposed patches