Re: backup to partitioned table

Поиск
Список
Период
Сортировка
От David G. Johnston
Тема Re: backup to partitioned table
Дата
Msg-id CAKFQuwZFApPf=Zrq2tsJ16tRoG_t-50wfPCLwiK6F3wOzZXtEw@mail.gmail.com
обсуждение исходный текст
Ответ на backup to partitioned table  (Erik Serrano <eserranos@gmail.com>)
Ответы Re: backup to partitioned table  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-admin
On Wed, Nov 16, 2022 at 8:56 AM Erik Serrano <eserranos@gmail.com> wrote:
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.

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.


I presume you are doing something with pg_dump...don't.

Use a "COPY" command (or psql \copy) to produce the CSV file instead.  pg_dump has its own ideas about how to go about producing an actual backup when all you really want is a copy of the data.  Because its idea of a backup means having one csv file for each of the child tables in the partition scheme.

David J.

В списке pgsql-admin по дате отправления:

Предыдущее
От: Erik Serrano
Дата:
Сообщение: backup to partitioned table
Следующее
От: Scott Ribe
Дата:
Сообщение: Re: backup to partitioned table