Re: BUG #16732: pg_dump creates broken backups

From: Zsolt Ero <zsolt(dot)ero(at)gmail(dot)com>
To: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>, PostgreSQL mailing lists <pgsql-bugs(at)lists(dot)postgresql(dot)org>
Subject: Re: BUG #16732: pg_dump creates broken backups
Date: 2020-11-22 11:50:14
Message-ID: CAKw-smBUUTYNJQJ21+LEOEnCqPLWfX0XVixA3eHBcAT3Nh33pQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

>
> Why do you do that? It seems much easier to produce a complete dump,
> then obtain the --list from it, do "grep -v" of the TABLE DATA element
> for that table, then give that file to pg_restore. It would restore
> everything in the right order, including that table's definition, but
> excluding that table's data.
>

Can you help me how can I do this?

Here is what I was doing before, which triggered the bug:

pg_restore --schema-only --format=custom --single-transaction $BACKUP_FILE

pg_restore --list $BACKUP_FILE > dump_list.full
grep -v "public events_map" dump_list.full > dump_list.main

pg_restore --data-only --format=custom --use-list=dump_list.main --jobs=4
$BACKUP_FILE

If it's not clear, I'd like to restore the original database 1:1, but
without the data included in the "events_map" table. I mean the results
should be the same as if I'd run truncate after import.

Zsolt

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Susanne & Udo Krause 2020-11-22 13:31:25 lc_collate mess
Previous Message Tom Lane 2020-11-21 22:34:37 Re: BUG #16730: Create table like with inheritance and self referencing index