pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Stephen Frost <sfrost@snowman.net>
To: Christoph Berg <christoph.berg@credativ.de>
To: PostgreSQL Hackers <pgsql-hackers@postgresql.org>
Subject: Re: [PATCH] Log PostgreSQL version number on startup
Date: Wed, 21 Nov 2018 11:32:46 -0500
Message-ID: <20181121163246.GR3415@tamriel.snowman.net> (raw)
In-Reply-To: <20181121144611.GJ15795@msg.credativ.de>
References: <20181121144611.GJ15795@msg.credativ.de>

Greetings,

* Christoph Berg (christoph.berg@credativ.de) wrote:
> it has bugged me for a long time that there's no clear "PostgreSQL is
> starting" message in the server log file. I'd like to change that for
> two reasons:

+1

> * when reading a long log file, it's not entirely clear where a new
>   server startup begins.
> 
>   It was worse in the past (first message was "database system was
>   shut down at..." which rather looks like a shutdown message to
>   newbie users), now it's "listening on IPv6..." but that message
>   might possibly become DEBUG1, or listen_addresses might become
>   changeable at run-time
> 
> * while upgrading servers, it's useful to know which server version
>   was actually started if there are several startup attempts
> 
> The change would be to log "Starting PG_VERSION_STR" as early as
> possible.
> 
> A startup looks like this:
> 
> 2018-11-21 15:19:47.259 CET [24453] LOG:  listening on IPv6 address "::1", port 5431
> 2018-11-21 15:19:47.259 CET [24453] LOG:  listening on IPv4 address "127.0.0.1", port 5431
> 2018-11-21 15:19:47.315 CET [24453] LOG:  listening on Unix socket "/tmp/.s.PGSQL.5431"
> 2018-11-21 15:19:47.394 CET [24453] LOG:  starting PostgreSQL 12devel on x86_64-pc-linux-gnu, compiled by gcc (Debian 8.2.0-9) 8.2.0, 64-bit
> 2018-11-21 15:19:47.426 CET [24454] LOG:  database system was shut down at 2018-11-21 15:15:35 CET
> 2018-11-21 15:19:47.460 CET [24453] LOG:  database system is ready to accept connections
> 
> (I'd rather put the start message before the listening messages, but I
> think the startup message should be logged via logging_collector, and
> listening is logged before the log file is opened.)

I wonder if maybe we should do both (though with an appropriate "logs
now being logged through the logging collector" or some such).

I've not really looked at the patch at all, but definitely like the
idea.

Thanks!

Stephen

Attachments:

  [application/pgp-signature] signature.asc (818B, ../20181121163246.GR3415@tamriel.snowman.net/2-signature.asc)
  download

view thread (12+ messages)  latest in thread

Message-ID: <20181121163246.GR3415@tamriel.snowman.net>
Permalink:  ../20181121163246.GR3415@tamriel.snowman.net/
Also on:    postgresql.org/message-id/20181121163246.GR3415@tamriel.snowman.net

 · 

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 using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: sfrost@snowman.net, christoph.berg@credativ.de
  Subject: Re: [PATCH] Log PostgreSQL version number on startup
  In-Reply-To: <20181121163246.GR3415@tamriel.snowman.net>

* 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