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 1kxcyO-0007QR-Ru for pgsql-hackers@arkaria.postgresql.org; Thu, 07 Jan 2021 21:37:37 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kxcyN-0000Nc-M1 for pgsql-hackers@arkaria.postgresql.org; Thu, 07 Jan 2021 21:37:35 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kxcyN-0000NV-BW for pgsql-hackers@lists.postgresql.org; Thu, 07 Jan 2021 21:37:35 +0000 Received: from mail-ed1-x52a.google.com ([2a00:1450:4864:20::52a]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1kxcyG-000682-4S for pgsql-hackers@lists.postgresql.org; Thu, 07 Jan 2021 21:37:34 +0000 Received: by mail-ed1-x52a.google.com with SMTP id p22so9096014edu.11 for ; Thu, 07 Jan 2021 13:37:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=enterprisedb-com.20150623.gappssmtp.com; s=20150623; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=yO6EVPGHlx9Dn0J74fWwrKPy9hwBNhJ0Wo03NQ+9Zik=; b=IQSpTcPe+trksAVXiSxnlVBhLBoPdGRL9OHVzuwU6NKyrgXsHGXwGQGuMOyOAFKunp +Z4rkllAcNY7CQ4br2v0HT48tMb/1o3RzzLpRGbb8hrkNIQ1YAbpA5to4qgzrHvb6mVP yyTAQ48OAP4kO/AB4WePyD12NaaPzXHOq4Z6au00wYfihaM4S6AZ33R8VhATVy0XIkKB EA0EnbTwzTA1/ZcklrLqju1sJomQyTDlWmJLOQqJLRellUqTEh1QfdFPjTjQDhcMC3eV JAC73F3nvfWnOlXW0jl5LAusOVXOZbhPTMU75Yb54XqFKa9SwoSrcLyFQ9pQeejBosGH zsGg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=yO6EVPGHlx9Dn0J74fWwrKPy9hwBNhJ0Wo03NQ+9Zik=; b=Yqwi24vI1qQlrZSg/cwcSqd3EDlOt8Ajlx0eF/33hN+vZk/1ehA9fhnSj9CSqOSQ2I ECCb4jxpmrgtcrrcOrkD5mlslk5iDvdP7eup8hknusLQF+qU3OVLxLeAdny5Bgs+Aa82 NHl/DMUjR16gFhTWVn+bI2MBmkLqjZwIDYTfJQ52jny2Z/LnyaYrfAYvS6zoQCehxb1Y 7kXVFvQVbA1zuCGQHJ4xdBxi7qynf1FHif0Bq8vFeJJgXpsVxF0nwV6CL7K49QMcw4mM b65yfPAVEHJeu516BQ3JX/hzIodsbU01NTua6zp9L46OHhfiZL9NB87mm4wdXVfaJbKr 7efQ== X-Gm-Message-State: AOAM531qkPRi4vxqwRUwLFtzaoRq14iloHzEIE09MDl4Zk2DBvBuPl1j PCej0hcQjSXfPemGqhXoPPXNgP2wx/D9eLAaQCq8aDkZ2WfzDogojmrhcKlZVvulTtzrAsOOU8o gI0VDOKH/1PTSWOn84RNbyRSbGBooTfOPkwficupXi5BJwzANDfH0TmWEsxrlhoZtlX2QjvlgxJ bGJDwnv9L4WT7Fk4aD2v0df75uaWgJ3nLn9O3NSB5lVvwnZjNF7dXHHMDbjp5Ixej/nmkcDzcFX uxv7elwpXcg7nz9E29/CgD8Nvy3/YeHexZxTx/H9jRk+IMPnqd6oKxK X-Google-Smtp-Source: ABdhPJy1XVX3elB/LHmFfOA1f8ZxZRTrN0fDu5+fh3vNnS7fmm3HE6NwwMrI46TKMGg86GZrLsGwGg== X-Received: by 2002:a05:6402:2553:: with SMTP id l19mr2836407edb.326.1610055444807; Thu, 07 Jan 2021 13:37:24 -0800 (PST) Received: from [10.137.0.20] (ip-86-49-249-71.net.upcbroadband.cz. [86.49.249.71]) by smtp.gmail.com with ESMTPSA id j20sm2848338ejy.124.2021.01.07.13.37.23 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 07 Jan 2021 13:37:23 -0800 (PST) Subject: Re: [PATCH] Simple progress reporting for COPY command To: =?UTF-8?B?Sm9zZWYgxaBpbcOhbmVr?= , Matthias van de Meent Cc: PostgreSQL Hackers References: <6e7b056e-faff-40f6-730d-3ad6d2d1b5e9@enterprisedb.com> <1562ca9b-ffb5-e5e9-0399-33db90dbe153@enterprisedb.com> From: Tomas Vondra Message-ID: Date: Thu, 7 Jan 2021 22:37:21 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.6.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-CLOUD-SEC-AV-Info: enterprisedb,google_mail,monitor X-CLOUD-SEC-AV-Sent: true X-Gm-Spam: 0 X-Gm-Phishy: 0 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 1/7/21 7:56 PM, Josef Šimánek wrote: > čt 7. 1. 2021 v 19:51 odesílatel Matthias van de Meent > napsal: >> >> On Wed, 6 Jan 2021 at 22:45, Tomas Vondra wrote: >>> >>> On 1/5/21 11:02 AM, Josef Šimánek wrote: >>>> I'm attaching the whole patch since commitfest failed to ingest the >>>> last incremental on CI. >>>> >>> >>> Yeah, the whole patch needs to be attached for the commitfest tester to >>> work correctly - it can't apply pieces from multiple messages, etc. >>> >>> Anyway, I pushed this last version of patch, after a couple more tweaks, >>> mainly to the docs - one place used pg_stat_copy_progress, the section >>> was not indexed properly, and so on. >> >> Thank you all, I'd love to use this in the future to keep track of >> (e.g.) my backup/restore progress. >> >> For my previously mentioned extension to keep track of filtered tuples >> that are excluded by the WHERE-clause, PFA patch 0001 that keeps track >> of that, in line with the current column name style of lines. > > If I understand it well, this column could be used on COPY TO to track > skipped lines because of BEFORE TRIGGER, right? I can include this in > my following patch keeping lines_processed incremented even for > skipped lines as well. > That's my understanding too. >> If so desired, I'll split this off into a different thread & CF entry. >> >>> I see Matthias proposed to change "lines" to "tuples" - I only saw the >>> message after pushing, but I probably wouldn't make that change anyway. >>> The CSV docs seem to talk about lines, newlines etc. so it seems fine. >>> If not, we can change that. >> >> The CSV docs, sure. But copy doesn't only process CSVs; it also has >> text (which does have a # lines = # tuples / rows guarantee) and >> binary (in which the 'line' vocabulary doesn't make sense, and in >> which the 'tuples' vocabulary is used). Additionally, most mentions of >> postgres' logical rows/tuples in the COPY documentation use the 'rows' >> terminology ('tuples' for FORMAT BINARY), and use 'line' only for >> external format's textual representation's strings delimited by >> newlines (which I believe is not exactly what we're counting). >> >> One common user of COPY is the pg_dump tool, and that uses binary >> format by default (iirc). >> >> Additionally, all comments surrounding the *LINES_PROCESSED updates >> only mention 'tuples', so I'd like to strongly suggest (a variant of) >> attached patch 0002 to keep the vocabulary consistent by using >> 'tuples' instead of 'lines'. >> I'm not particularly attached to the "lines" naming, it just seemed OK to me. So if there's consensus to rename this somehow, I'm OK with it. regards -- Tomas Vondra EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company