pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Wells Oliver <wells.oliver@gmail.com>
Cc: pgsql-admin <pgsql-admin@postgresql.org>
Subject: Re: Gauging progress of COPY?
Date: Thu, 20 Jan 2022 13:13:18 -0500
Message-ID: <892470.1642702398@sss.pgh.pa.us> (raw)
In-Reply-To: <CAOC+FBXWEh2U8m6NFAhjv--YS8=1Mm4ae6UJyJSdzeRB6d3N-A@mail.gmail.com>
References: <CAOC+FBXWEh2U8m6NFAhjv--YS8=1Mm4ae6UJyJSdzeRB6d3N-A@mail.gmail.com>

Wells Oliver <wells.oliver@gmail.com> writes:
> Is there some clever way to gauge the progress of a COPY command? i.e. you
> know it has 10m rows, but you can't SELECT COUNT(*).

If it's a COPY IN (to a table) you could monitor growth of the
physical size of the table, cf pg_relation_size().  This isn't
terribly satisfactory if you're not clear on how much space each
row will take, but it's something.

			regards, tom lane





view thread (6+ messages)  latest in thread

Message-ID: <892470.1642702398@sss.pgh.pa.us>
Permalink:  ../892470.1642702398@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/892470.1642702398@sss.pgh.pa.us

 · 

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-admin@postgresql.org
  Cc: tgl@sss.pgh.pa.us, wells.oliver@gmail.com
  Subject: Re: Gauging progress of COPY?
  In-Reply-To: <892470.1642702398@sss.pgh.pa.us>

* 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