Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nAbwM-0005ec-4g for pgsql-admin@arkaria.postgresql.org; Thu, 20 Jan 2022 18:13:42 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nAbwK-00009b-NB for pgsql-admin@arkaria.postgresql.org; Thu, 20 Jan 2022 18:13:40 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nAbwK-00009R-DH for pgsql-admin@lists.postgresql.org; Thu, 20 Jan 2022 18:13:40 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nAbwI-0006kt-Cy for pgsql-admin@postgresql.org; Thu, 20 Jan 2022 18:13:40 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 20KIDIJM892471; Thu, 20 Jan 2022 13:13:18 -0500 From: Tom Lane To: Wells Oliver cc: pgsql-admin Subject: Re: Gauging progress of COPY? In-reply-to: References: Comments: In-reply-to Wells Oliver message dated "Thu, 20 Jan 2022 10:00:33 -0800" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <892469.1642702398.1@sss.pgh.pa.us> Date: Thu, 20 Jan 2022 13:13:18 -0500 Message-ID: <892470.1642702398@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Wells Oliver 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