Re: pg_dump, ATTACH, and independently restorable child partitions

Justin Pryzby <pryzby@telsasoft.com>

From: Justin Pryzby <pryzby@telsasoft.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Alvaro Herrera <alvherre@alvh.no-ip.org>, David Rowley <drowley@postgresql.org>, pgsql-hackers@lists.postgresql.org
Date: 2021-08-30T15:42:49Z
Lists: pgsql-hackers
On Wed, Nov 25, 2020 at 06:35:19PM -0500, Tom Lane wrote:
> What we'd need to do if we want this to work with direct-to-DB restore                                                                                                                                    
> is to split off the ATTACH PARTITION command as a separate TOC entry.                                                                                                                                     
> That doesn't seem amazingly difficult, and it would even offer the                                                                                                                                        
> possibility that you could extract the partition standalone without                                                                                                                                       
> having to ignore errors.  (You'd use -l/-L to select the CREATE TABLE,                                                                                                                                    
> the data, etc, but not the ATTACH object.)                                                                                                                                                                

On Mon, Jan 11, 2021 at 09:28:18PM -0500, Tom Lane wrote:
> Justin Pryzby <pryzby@telsasoft.com> writes:
> > [ v5-0001-pg_dump-output-separate-object-for-ALTER-TABLE.AT.patch ]
> 
> Pushed with mostly cosmetic edits.

Thanks for pushing (9a4c0e36f).

Should this be included in the release notes ?

It's a user-visible change visible in pg_restore -l.  Someone might be
surprised that the attach "object" needs to be included for restore -L to
behave the same as it use to.

--
-- Name: cdrs_2021_08_22; Type: TABLE ATTACH; Schema: child; Owner: telsasoft
--

7949; 1259 1635139558 TABLE child cdrs_2021_08_24 telsasoft
62164; 0 0 TABLE ATTACH child cdrs_2021_08_24 telsasoft
;       depends on: 7949

-- 
Justin



Commits

  1. pg_dump: label INDEX ATTACH ArchiveEntries with an owner.

  2. Dump ALTER TABLE ... ATTACH PARTITION as a separate ArchiveEntry.

  3. Make pg_dump emit ATTACH PARTITION instead of PARTITION OF (reprise)