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 1pYjLJ-0007Kn-2d for pgsql-hackers@arkaria.postgresql.org; Sun, 05 Mar 2023 08:03:41 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pYjLH-00026B-OL for pgsql-hackers@arkaria.postgresql.org; Sun, 05 Mar 2023 08:03:39 +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 1pYjLH-000262-Ca for pgsql-hackers@lists.postgresql.org; Sun, 05 Mar 2023 08:03:39 +0000 Received: from mail-wm1-x331.google.com ([2a00:1450:4864:20::331]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1pYjLD-0001Lt-Jh for pgsql-hackers@lists.postgresql.org; Sun, 05 Mar 2023 08:03:38 +0000 Received: by mail-wm1-x331.google.com with SMTP id j3so3900685wms.2 for ; Sun, 05 Mar 2023 00:03:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=migops.com; s=google; t=1678003414; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=LN53R1u4WF4omYY8cSOldQ4n4ftceAvgII6xXQlgQEo=; b=jHiz7KsxQ/miiqKkZhSXcb7r8cRzXuoDrnoM1KFSeNfRI2nTGf7EdSU2QdhMn2/pWQ xMWjoDhyKl69GbXznl9osOiDYHv7jkJAmS9G/p6v8YFyxrcDaR8ta4kgZzciOFykLOyo vHP6qv8iu/9Jhn2wZBABcKKj5dl4Jm0r+UcqsLOrfA8JDtwXM5KgUTBCBjTREG/ybZBt YENG2fZo3H5cdD9liN69DLiWQLJ6nPvy9jiMon50FA4Ehf4EHtLWOelJjkjIrDI/UWu5 f6QW3nCG6FbOPpg81Xvwe4tD3DIZT5FtBgWGd0KcWV0JBPHbSVh/8xSd56UcLLweJ5t5 VyOA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678003414; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=LN53R1u4WF4omYY8cSOldQ4n4ftceAvgII6xXQlgQEo=; b=0zuG8aevyc0xA9nUiCh8k7+STy+WpyqSQUbTk06KsuIYWarWquIDJ3icpqJQUDpDMa RvyeYGSZPWOUdgLsTuE5Y1uys9Q3Hjql1D2fb63cNEFwtXuLjVJ6B5fHCJU7/af/AZ6G aqBCDjNaQugyCJTfdc9VeNpyXlP2nnQFVJrFbDkcxVodehgSwzdQFrQmmBEouYwgt0uk Lt898uy4IZ61Dwv/wFw0vUfXL1QXFs6f3DR4We5y55QViPjN4HGKb2Mtz7eITiK0SV0F dLBeDkKuN9zTRJM0Buf9aFDksqr4qQF95o39tX67FVE2RrVb0jCJ7qn97DeGf+8OUI8h +rhQ== X-Gm-Message-State: AO0yUKVPfR+EKMj5J9ZcSqAVRAbsvd+A0xRvlPpwng+LZ80bJgv5FdxF mqgMHjOtMFf0urj1dzOmOwIjfQ== X-Google-Smtp-Source: AK7set8I7roD/uOGI7Q3ExM6LJ7SpX0/a8hFDY7KcOr6GDP4eNLdH6YbaKL+ecnQxb0t5VXH8hwvrg== X-Received: by 2002:a05:600c:3c87:b0:3eb:39e2:9157 with SMTP id bg7-20020a05600c3c8700b003eb39e29157mr6490108wmb.22.1678003414516; Sun, 05 Mar 2023 00:03:34 -0800 (PST) Received: from ?IPV6:2a01:cb14:51d:5100:2c8:caa7:3b62:abcf? ([2a01:cb14:51d:5100:2c8:caa7:3b62:abcf]) by smtp.gmail.com with ESMTPSA id n5-20020a5d4c45000000b002c55306f6edsm6541623wrt.54.2023.03.05.00.03.33 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 05 Mar 2023 00:03:33 -0800 (PST) Message-ID: <84edf9a5-c59c-2644-1ac8-7ac5b13f2891@migops.com> Date: Sun, 5 Mar 2023 08:03:33 +0000 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.7.1 Subject: Re: [Proposal] Allow pg_dump to include all child tables with the root table Content-Language: en-US To: Tom Lane , Gilles Darold Cc: pgsql-hackers@lists.postgresql.org References: <5aa393b5-5f67-8447-b83e-544516990ee2@migops.com> <167727895770.12579.12160318039902297475.pgcf@coridan.postgresql.org> <04a4dcee-bd2c-8cc1-0f6f-704d2083f179@migops.com> <2984786.1677957493@sss.pgh.pa.us> From: Gilles Darold In-Reply-To: <2984786.1677957493@sss.pgh.pa.us> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Le 04/03/2023 à 19:18, Tom Lane a écrit : > Gilles Darold writes: >> But I disagree the use of --table-with-childs and >> --exclude-table-with-childs because we already have the --table and >> --exclude-table, and it will add lot of code where we just need a switch >> to include children tables. > I quite dislike the idea of a separate --with-whatever switch, because > it will (presumably) apply to all of your --table and --exclude-table > switches, where you may need it to apply to just some of them. > Spelling considerations aside, attaching the property to the > individual switches seems far superior. And I neither believe that > this would add a lot of code, nor accept that as an excuse even if > it's true.y.. Right, this is not a lot of code but just more code where I think we just need a switch. I much prefer that it applies to all --table / --exclude-table because this is generally the behavior we want for all root/parent tables. But I agree that in some cases users could want that this behavior applies to some selected tables only so the proposed new options can answer to this need. Even if generally in similar cases several pg_dump commands can be used. This is just my opinion, I will adapt the patch to use the proposed new options. But, what do you think about having pg_dump default to dump children tables with --table / --exclude-table? I was very surprised that this was not the case the first time I see that. In this case we could add --[exclude-]table-no-child-tables. I think this form will be less used than the form where we need the child tables to be dump with the parent table, meaning that most of the time pg_dump commands using --table and --exclude-table will be kept untouched and those using more regexp to dump child tables could be simplified. I'm not sure that the backward compatibility is an argument here to not change the default behavior of pg_dump. -- Gilles -- Gilles Darold