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 1ovKvo-0007av-MN for pgsql-admin@arkaria.postgresql.org; Wed, 16 Nov 2022 16:06:32 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1ovKvn-0007jv-Aa for pgsql-admin@arkaria.postgresql.org; Wed, 16 Nov 2022 16:06:31 +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 1ovKvm-0007jm-WA for pgsql-admin@lists.postgresql.org; Wed, 16 Nov 2022 16:06:30 +0000 Received: from mailout.easymail.ca ([64.68.200.34]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ovKvk-0004i0-9G for pgsql-admin@lists.postgresql.org; Wed, 16 Nov 2022 16:06:29 +0000 Received: from localhost (localhost [127.0.0.1]) by mailout.easymail.ca (Postfix) with ESMTP id DDCE4E6DBD; Wed, 16 Nov 2022 16:06:25 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at emo08-pco.easydns.vpn Received: from mailout.easymail.ca ([127.0.0.1]) by localhost (emo08-pco.easydns.vpn [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id EKD6q0wcLMPK; Wed, 16 Nov 2022 16:06:25 +0000 (UTC) Received: from smtpclient.apple (unknown [165.140.184.195]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mailout.easymail.ca (Postfix) with ESMTPSA id 8001BE6D3A; Wed, 16 Nov 2022 16:06:25 +0000 (UTC) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.200.110.1.12\)) Subject: Re: backup to partitioned table From: Scott Ribe In-Reply-To: Date: Wed, 16 Nov 2022 09:06:14 -0700 Cc: Pgsql-admin Content-Transfer-Encoding: quoted-printable Message-Id: References: To: Erik Serrano X-Mailer: Apple Mail (2.3731.200.110.1.12) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk > On Nov 16, 2022, at 8:56 AM, Erik Serrano wrote: >=20 > Hello Guys,=20 > I have a case that I would like you to help me with. >=20 > I have a partitioned table in postgresql version 9,5 to which I select = and it returns data perfectly, but when I want to make a backup of the = table, it only saves the structure without records. > It should be noted that I am not making a backup of the structure, but = of the data or complete, but it does not back up the data anyway. > When consulting the administrator, he informs me that it is a = partitioned table and that it is always zero, but the data is in its = "daughter" tables and that the select that it returns is the information = that is housed in all its daughter tables. >=20 > Now, given this, I wanted to know if there is any way to make a backup = of the table that throws all the data from its child tables into a flat = file. >=20 > Is it possible to perform this action? > =46rom already thank you very much You have to dump all the child tables; usually partitions are named = reasonably such that a wildcard can do it: pg_dump -t root_table_name\* > backup.sql You don't exactly get a "flat" backup, as all the individual tables are = included, but you do get it all into one file, if that's good enough for = you.=