pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Ron <ronljohnsonjr@gmail.com>
To: PostgreSQL <pgsql-general@lists.postgresql.org>
Subject: Re: pg_dump - how to force to show timestamps in client log
Date: Sat, 21 Nov 2020 03:31:09 -0600
Message-ID: <854e2c76-8dba-b9d7-281a-658ce64df4d4@gmail.com> (raw)
In-Reply-To: <CADZ4tWPcmFCTCiyc9uyCS-nidTOSp0n=v-hZWpdeBPvFc38VJA@mail.gmail.com>
References: <CAEcMXhkrsYX3W-Co1dGasVv-qoCcpJRJFE9Dx+ww4HmvrvZz_A@mail.gmail.com>
	<c7df7ab3-aaa3-7b47-dc41-08a205f00785@aklaver.com>
	<7919898d-f5c5-44f0-5af3-41808ba71dfc@gmail.com>
	<96a0c112-0ecd-ebe1-fba3-604ab25276bd@aklaver.com>
	<c2f780bb-e115-2568-c968-2574fd73b303@gmail.com>
	<CADZ4tWPcmFCTCiyc9uyCS-nidTOSp0n=v-hZWpdeBPvFc38VJA@mail.gmail.com>

TBH, it's also been a while since I needed to monitor pg_dump, since we now 
use pgbackrest (which just so happens to have a progress meter...).

On 11/20/20 4:32 PM, Mark Johnson wrote:
> This all sounds like a previous discussion on pg hackers about a progress 
> meter for pg_dump.  Search the archives for that discussion.  Also, search 
> the web for something like "pg_dump progress meter" and you'll get a few 
> suggestions like pipe to pv, although that does not appear to work with 
> all of the file formats supported by pg_dump.
>
> What do you see in pg_stat_activity?  It's been a while since I tried to 
> monitor a running pg_dump.
>
>  Also, if you redirect the output to a file then doesn't the file's 
> timestamp get updated each time something happens. (That's what I used to 
> do with Oracle before they added timestamps).
>
> On Fri, Nov 20, 2020 at 5:00 PM Ron <ronljohnsonjr@gmail.com 
> <mailto:ronljohnsonjr@gmail.com>> wrote:
>
>     On 11/20/20 3:39 PM, Adrian Klaver wrote:
>     > On 11/20/20 1:00 PM, Ron wrote:
>     >> On 11/20/20 2:56 PM, Adrian Klaver wrote:
>     >>> On 11/20/20 10:01 AM, Durumdara wrote:
>     >>>> Hello!
>     >>>>
>     >>>> 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
>     >>>> ...
>     >>>> etc.
>     >>>
>     >>>
>     >>> If you are redirecting to a file it have the creation time that
>     you can
>     >>> use. Internally times don't really matter for the objects as the
>     dump is
>     >>> based on a snapshot. Said snapshot is based on visible
>     transactions not
>     >>> time. So for practical purposes they all occur at the same 'time'.
>     >>
>     >> It makes all the difference when monitoring the progress of a backup.
>     >>
>     >
>     > With -v you will get running list of objects dumped, just not the time.
>     > The time is only of value relative to the following. Progress will
>     only be
>     > measurable by determining what is left to run and the time for each
>     > object. Not sure that is feasible as you would have to pre-run the
>     dump to
>     > get information about the number of objects and an estimate of the data
>     > quantity involved and the effect of each on the other. I could see that
>     > estimate getting worse the bigger the data set(and hence the more you
>     > cared) got. Because at some point the load on the machine would
>     affect the
>     > output speed of the dump.
>
>     By knowing the sizes of the tables, and how long it takes to takes the
>     first
>     "some" tables, then one can forecast how long it takes to backup the
>     whole
>     database.
>
>     -- 
>     Angular momentum makes the world go 'round.
>
>

-- 
Angular momentum makes the world go 'round.

view thread (9+ messages)  latest in thread

Message-ID: <854e2c76-8dba-b9d7-281a-658ce64df4d4@gmail.com>
Permalink:  ../854e2c76-8dba-b9d7-281a-658ce64df4d4@gmail.com/
Also on:    postgresql.org/message-id/854e2c76-8dba-b9d7-281a-658ce64df4d4@gmail.com

 · 

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: ronljohnsonjr@gmail.com
  Subject: Re: pg_dump - how to force to show timestamps in client log
  In-Reply-To: <854e2c76-8dba-b9d7-281a-658ce64df4d4@gmail.com>
  References: <CAEcMXhkrsYX3W-Co1dGasVv-qoCcpJRJFE9Dx+ww4HmvrvZz_A@mail.gmail.com> <c7df7ab3-aaa3-7b47-dc41-08a205f00785@aklaver.com> <7919898d-f5c5-44f0-5af3-41808ba71dfc@gmail.com> <96a0c112-0ecd-ebe1-fba3-604ab25276bd@aklaver.com> <c2f780bb-e115-2568-c968-2574fd73b303@gmail.com> <CADZ4tWPcmFCTCiyc9uyCS-nidTOSp0n=v-hZWpdeBPvFc38VJA@mail.gmail.com> <854e2c76-8dba-b9d7-281a-658ce64df4d4@gmail.com>

* 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