Heyho!

On Wednesday 25 August 2010 09.15:33 wstrzalka wrote:
> I'm currently playing with very large data import using COPY from
> file.
> 
> As this can be extremely long operation (hours in my case) the nice
> feature would be some option to show operation progress - how many
> rows were already imported.

Recently, I've found (on Linux, don't know if other OSs export this 
information) /proc/<pid>/fdinfo/<fd> extremely helpful.  It tells you the 
position of the file pointer of file number <fd> in process <pid> (I guess 
for a COPY import this would be the postgresql backend handling your import 
session.)

Unlike other options, you can also use this if you only notice that the 
process is long-running after you've already started it.

Of course it probably will not work if the file is mmapped or otherwise not 
read in a sequential fashion.

cheers
-- vb

-- 
All Hail Discordia!

Attachment: signature.asc
Description: This is a digitally signed message part.

Reply via email to