pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Peter J. Holzer <hjp-pgsql@hjp.at>
To: pgsql-general@lists.postgresql.org
Subject: Re: pg_dump - how to force to show timestamps in client log
Date: Sat, 21 Nov 2020 12:07:05 +0100
Message-ID: <20201121110705.GA19224@hjp.at> (raw)
In-Reply-To: <CAEcMXhkrsYX3W-Co1dGasVv-qoCcpJRJFE9Dx+ww4HmvrvZz_A@mail.gmail.com>
References: <CAEcMXhkrsYX3W-Co1dGasVv-qoCcpJRJFE9Dx+ww4HmvrvZz_A@mail.gmail.com>

On 2020-11-20 19:01:47 +0100, Durumdara wrote:
> We need to log the pg_dump's state.
> What objects are in copy, and what are the starting and ending times.
> 
> But when I try to redirect the output, the result doesn't have timestamps.
> 
> PG 11, on Windows.
> 
> As I see the -v option isn't enough to see the starting times.
> 
> For example:
> 
> 2020-11-19 12:00:01.084 Dump table content table1
> 2020-11-19 12:03:12.932 Dump table content table2

You can pipe the output through a timestamping tool like this:

pg_dump --compress=5 -v -Fd -f "$name.$$" $db 2>&1 | ts > log/"$name".$(isodate).log

ts is available here: https://github.com/hjp/simple/tree/master/ts

        hp

-- 
   _  | Peter J. Holzer    | Story must make more sense than reality.
|_|_) |                    |
| |   | hjp@hjp.at         |    -- Charles Stross, "Creative writing
__/   | http://www.hjp.at/ |       challenge!"

Attachments:

  signature.asc (application/pgp-signature, 832B) download

view thread (9+ messages)

Message-ID: <20201121110705.GA19224@hjp.at>
Permalink:  ../20201121110705.GA19224@hjp.at/
Also on:    postgresql.org/message-id/20201121110705.GA19224@hjp.at

 · 

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: hjp-pgsql@hjp.at
  Subject: Re: pg_dump - how to force to show timestamps in client log
  In-Reply-To: <20201121110705.GA19224@hjp.at>
  References: <CAEcMXhkrsYX3W-Co1dGasVv-qoCcpJRJFE9Dx+ww4HmvrvZz_A@mail.gmail.com> <20201121110705.GA19224@hjp.at>

* 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