Re: pg_dump, ATTACH, and independently restorable child partitions

From: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
To: Justin Pryzby <pryzby(at)telsasoft(dot)com>
Cc: David Rowley <drowley(at)postgresql(dot)org>, pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: pg_dump, ATTACH, and independently restorable child partitions
Date: 2020-11-07 02:18:35
Message-ID: 20201107021835.GA13348@alvherre.pgsql
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2020-Oct-24, Justin Pryzby wrote:

> On Fri, Oct 23, 2020 at 12:29:40AM -0500, Justin Pryzby wrote:

> > Now that I look, it seems like this is calling PQexec(), which sends a single,
> > "simple" libpq message with:
> > |CREATE TABLE ..; ALTER TABLE .. ATTACH PARTITION;
> > ..which is transactional, so when the 2nd command fails, the CREATE is rolled back.
> > https://www.postgresql.org/docs/9.5/libpq-exec.html#LIBPQ-EXEC-MAIN
>
> The easy fix is to add an explicit begin/commit.

Hmm, I think this throws a warning when used with "pg_restore -1",
right? I don't think that's sufficient reason to discard the idea, but
it be better to find some other way.

I have no ideas ATM :-(

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2020-11-07 02:52:49 Re: First-draft release notes for back branches are up
Previous Message Michael Paquier 2020-11-07 01:47:03 Re: "unix_socket_directories" should be GUC_LIST_INPUT?