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 1kkc8K-0003fZ-Dp for pgsql-general@arkaria.postgresql.org; Thu, 03 Dec 2020 00:06:04 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kkc8H-0006Ys-EG for pgsql-general@arkaria.postgresql.org; Thu, 03 Dec 2020 00:06:01 +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 1kkc8H-0006Yl-4G for pgsql-general@lists.postgresql.org; Thu, 03 Dec 2020 00:06:01 +0000 Received: from mail-ot1-x344.google.com ([2607:f8b0:4864:20::344]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1kkc8F-00082s-4b for pgsql-general@postgresql.org; Thu, 03 Dec 2020 00:06:00 +0000 Received: by mail-ot1-x344.google.com with SMTP id h19so157223otr.1 for ; Wed, 02 Dec 2020 16:05:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-language; bh=AzMtswyufD+H73DoZsqVQ0p0aEmfNjGUcQ+3IXTdl24=; b=XxgD1GxfWJq7j2lbImnLFmrxWLKGtGbEiwKpv9fCDSLpQLQgZsqsqDTEqVCgbUJ1Fh VEEB2ldxPv/BduxUdMCeUq12OM9as4zSGe16hvhLb1d65Uti3uNtrkoJiDtfmSa+ZWgL 3IglIOrt/2wnxINNl/MY0c82g8T1srn65OdpWT3nyDu6c6NQHvUUQlIY/cwCtfKDbFRQ 7nQ0h+HAxSADOsSuPbBUrz4nLYmJT2XQJtKY2sS61b76NrMnC8yCyjVLbIcxbrJohm8Q ea+WeyuThjc6/sDRj8BOh6hUKDDoJJvpirpq9qmISaFAakFUlKcNaNtMSgL3QeGSz5v6 UF2Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language; bh=AzMtswyufD+H73DoZsqVQ0p0aEmfNjGUcQ+3IXTdl24=; b=dnAUAG57fcV1rLgVYpC6dw+BoT1TLOlw6nebdBe1d68JGYXxMgGywX+67ujUTs+Bwg sKmNq8guA3pi51dsTVvL9aq4S8Jc5W8PP4kZgevcJ8PiQB05lyaBXoFOh6kMVfY8dHKs LhLNHGvwlxLg4MyRJuR/sk71tOiVGYI1MKeUf+2nb+2W+idSEiSziJACkNkFMBt0Vovj uxsu1wfkDMdiRF3InMRr6O19seutoIPlGrUNhRQVbjkOsDJxk61foYLKgzytbNxQWj1/ Kss8bwFcToM//3akDKQPnbsvBfYkwS7lStP4BJBYGfJCk6e8R2t50x+hClBr/bgoV54/ zL0w== X-Gm-Message-State: AOAM533Rsoh0Cmxmhsg949N8tthtAWy0QW89NI/q/JMuQruSttL/446R P/FIpfwhblCqaS+lSHDceXZTRUFiv4ODlg== X-Google-Smtp-Source: ABdhPJx+qnWaBx6Jhna5Ev2kLmbozHRfJzvlivoty1WDzmP+pR+18ozywr2uuys9fnk00CLGzVF/xA== X-Received: by 2002:a9d:6859:: with SMTP id c25mr307235oto.41.1606953956737; Wed, 02 Dec 2020 16:05:56 -0800 (PST) Received: from [192.168.1.10] (ip174-67-141-204.no.no.cox.net. [174.67.141.204]) by smtp.googlemail.com with ESMTPSA id k23sm40420oih.52.2020.12.02.16.05.55 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 02 Dec 2020 16:05:56 -0800 (PST) Subject: Re: pg_dump of partitioned table not working. To: "pgsql-general@postgresql.org >> PG-General Mailing List" References: <6b713437-69e3-0383-0c5f-f2e01bd46daa@gmail.com> From: Ron Message-ID: <1d857216-a9b9-0d1c-ade3-73692ba5508d@gmail.com> Date: Wed, 2 Dec 2020 18:05:55 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/alternative; boundary="------------1259B9510F6AC6B73310BC68" Content-Language: en-US List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk This is a multi-part message in MIME format. --------------1259B9510F6AC6B73310BC68 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit On 12/2/20 5:42 PM, David G. Johnston wrote: > On Wednesday, December 2, 2020, Ron > wrote: > > What am I missing? > > postgres=# \d+ measurement >                            Partitioned table "public.measurement" > > > $ /usr/lib/postgresql/12/bin/pg_dump -p5433 -d postgres -t measurement > --data-only > > > I’m unsure whether to expect a dump of only the partitioned table’s data > to be empty or include everything.  I suspect “empty” is the correct > answer.  If you dump everything the individual tables would be dumped, and > not all partition should be dumped. The individual partition tables regularly (for some site-specific definition of "regularly") change, as new partitions are added and old partitions are dropped.  Or the DBA decides to change the partition scheme. Needing to remember all the partition names is absurd, especially when there might be dozens of them -- Angular momentum makes the world go 'round. --------------1259B9510F6AC6B73310BC68 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 8bit On 12/2/20 5:42 PM, David G. Johnston wrote:
On Wednesday, December 2, 2020, Ron <ronljohnsonjr@gmail.com> wrote:
What am I missing?

postgres=# \d+ measurement
                           Partitioned table "public.measurement"


$ /usr/lib/postgresql/12/bin/pg_dump -p5433 -d postgres -t measurement --data-only

I’m unsure whether to expect a dump of only the partitioned table’s data to be empty or include everything.  I suspect “empty” is the correct answer.  If you dump everything the individual tables would be dumped, and not all partition should be dumped.

The individual partition tables regularly (for some site-specific definition of "regularly") change, as new partitions are added and old partitions are dropped.  Or the DBA decides to change the partition scheme.

Needing to remember all the partition names is absurd, especially when there might be dozens of them

--
Angular momentum makes the world go 'round.
--------------1259B9510F6AC6B73310BC68--