From: Ron <ronljohnsonjr@gmail.com>
To: pgsql-admin@lists.postgresql.org
Subject: Re: backup to partitioned table
Date: Wed, 16 Nov 2022 10:12:20 -0600
Message-ID: <27d37670-c38f-69f9-9a9b-52a1775b32a0@gmail.com> (raw)
In-Reply-To: <CA+dvXXt=G+a=4C5j8rn9ZTjP+g-6tu3MtnMC0cKbWSH5Nk5ovA@mail.gmail.com>
References: <CA+dvXXt=G+a=4C5j8rn9ZTjP+g-6tu3MtnMC0cKbWSH5Nk5ovA@mail.gmail.com>
On 11/16/22 09:56, Erik Serrano wrote:
> Hello Guys,
> I have a case that I would like you to help me with.
>
> 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.
That is correct.
>
> 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*.
Flat file as in a CSV file?
>
> Is it possible to perform this action?
If you want to export it to a CSV (or tab-separated, etc, etc) flat file,
then -- if using psql, use the COPY or \COPY command; instead of simply
specifying a table name, copy the *query* (SELECT * FROM parent_table).
If that's not what you mean, please clarify.
--
Angular momentum makes the world go 'round.
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-admin@postgresql.org
Cc: ronljohnsonjr@gmail.com, pgsql-admin@lists.postgresql.org
Subject: Re: backup to partitioned table
In-Reply-To: <27d37670-c38f-69f9-9a9b-52a1775b32a0@gmail.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox