Re: Gauging progress of COPY? - Mailing list pgsql-admin

From Greg Spiegelberg
Subject Re: Gauging progress of COPY?
Date
Msg-id CAEtnbpXgiExESPx5Caqp+YEU5cRZ0LUbG6t99p5-hxhoM02Asg@mail.gmail.com
Whole thread Raw
In response to Re: Gauging progress of COPY?  (Magnus Hagander <magnus@hagander.net>)
List pgsql-admin
On Sat, Jan 22, 2022, 3:09 AM Magnus Hagander <magnus@hagander.net> wrote:


On Thu, Jan 20, 2022, 19:01 Wells Oliver <wells.oliver@gmail.com> wrote:
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 you can open a second connection, you can just query pg_stat_progress_copy. 

If COPY FROM STDIN the client can provide feedback since it is sending line by line. 
If size known...1%...5%...
If number of rows known... 10000... 20000...

I would think even a semi capable bash script could do it. 

-Greg

pgsql-admin by date:

Previous
From: Ron
Date:
Subject: Re: Determine potential change in table size after a column dropped?
Next
From: Wells Oliver
Date:
Subject: Re: Determine potential change in table size after a column dropped?