@@ -2003,12 +2003,14 @@ buildTocEntryArrays(ArchiveHandle *AH)
20032003 AH -> tocsByDumpId [te -> dumpId ] = te ;
20042004
20052005 /*
2006- * tableDataId provides the TABLE DATA item's dump ID for each TABLE
2007- * TOC entry that has a DATA item. We compute this by reversing the
2008- * TABLE DATA item's dependency, knowing that a TABLE DATA item has
2009- * just one dependency and it is the TABLE item.
2006+ * tableDataId provides the DATA item's dump ID for each TABLE TOC
2007+ * entry that has a TABLE DATA or PARTITIONED DATA item. We compute
2008+ * this by reversing the DATA item's dependency, knowing that its
2009+ * first dependency is the TABLE item.
20102010 */
2011- if (strcmp (te -> desc , "TABLE DATA" ) == 0 && te -> nDeps > 0 )
2011+ if (te -> nDeps > 0 &&
2012+ (strcmp (te -> desc , "TABLE DATA" ) == 0 ||
2013+ strcmp (te -> desc , "PARTITIONED DATA" ) == 0 ))
20122014 {
20132015 DumpId tableId = te -> dependencies [0 ];
20142016
@@ -2018,7 +2020,7 @@ buildTocEntryArrays(ArchiveHandle *AH)
20182020 * item's dump ID, so there should be a place for it in the array.
20192021 */
20202022 if (tableId <= 0 || tableId > maxDumpId )
2021- pg_fatal ("bad table dumpId for TABLE DATA item" );
2023+ pg_fatal ("bad table dumpId for %s item" , te -> desc );
20222024
20232025 AH -> tableDataId [tableId ] = te -> dumpId ;
20242026 }
@@ -3202,6 +3204,7 @@ _tocEntryRequired(TocEntry *te, teSection curSection, ArchiveHandle *AH)
32023204 {
32033205 if (strcmp (te -> desc , "TABLE" ) == 0 ||
32043206 strcmp (te -> desc , "TABLE DATA" ) == 0 ||
3207+ strcmp (te -> desc , "PARTITIONED DATA" ) == 0 ||
32053208 strcmp (te -> desc , "VIEW" ) == 0 ||
32063209 strcmp (te -> desc , "FOREIGN TABLE" ) == 0 ||
32073210 strcmp (te -> desc , "MATERIALIZED VIEW" ) == 0 ||
@@ -3256,13 +3259,14 @@ _tocEntryRequired(TocEntry *te, teSection curSection, ArchiveHandle *AH)
32563259 if (!te -> hadDumper )
32573260 {
32583261 /*
3259- * Special Case: If 'SEQUENCE SET' or anything to do with LOs, then it
3260- * is considered a data entry. We don't need to check for BLOBS or
3261- * old-style BLOB COMMENTS entries, because they will have hadDumper =
3262- * true ... but we do need to check new-style BLOB ACLs, comments,
3263- * etc.
3262+ * Special Case: If 'PARTITIONED DATA', ' SEQUENCE SET' or anything to
3263+ * do with LOs, then it is considered a data entry. We don't need to
3264+ * check for BLOBS or old-style BLOB COMMENTS entries, because they
3265+ * will have hadDumper = true ... but we do need to check new-style
3266+ * BLOB ACLs, comments, etc.
32643267 */
3265- if (strcmp (te -> desc , "SEQUENCE SET" ) == 0 ||
3268+ if (strcmp (te -> desc , "PARTITIONED DATA" ) == 0 ||
3269+ strcmp (te -> desc , "SEQUENCE SET" ) == 0 ||
32663270 strcmp (te -> desc , "BLOB" ) == 0 ||
32673271 strcmp (te -> desc , "BLOB METADATA" ) == 0 ||
32683272 (strcmp (te -> desc , "ACL" ) == 0 &&
@@ -5034,14 +5038,14 @@ identify_locking_dependencies(ArchiveHandle *AH, TocEntry *te)
50345038 return ;
50355039
50365040 /*
5037- * We assume the entry requires exclusive lock on each TABLE or TABLE DATA
5038- * item listed among its dependencies. Originally all of these would have
5039- * been TABLE items, but repoint_table_dependencies would have repointed
5040- * them to the TABLE DATA items if those are present (which they might not
5041- * be, eg in a schema-only dump). Note that all of the entries we are
5042- * processing here are POST_DATA; otherwise there might be a significant
5043- * difference between a dependency on a table and a dependency on its
5044- * data, so that closer analysis would be needed here.
5041+ * We assume the entry requires exclusive lock on each TABLE, TABLE DATA,
5042+ * or PARTITIONED DATA item listed among its dependencies. Originally all
5043+ * of these would have been TABLE items, but repoint_table_dependencies
5044+ * would have repointed them to the DATA items if those are present (which
5045+ * they might not be, eg in a schema-only dump). Note that all of the
5046+ * entries we are processing here are POST_DATA; otherwise there might be
5047+ * a significant difference between a dependency on a table and a
5048+ * dependency on its data, so that closer analysis would be needed here.
50455049 */
50465050 lockids = (DumpId * ) pg_malloc (te -> nDeps * sizeof (DumpId ));
50475051 nlockids = 0 ;
@@ -5050,8 +5054,9 @@ identify_locking_dependencies(ArchiveHandle *AH, TocEntry *te)
50505054 DumpId depid = te -> dependencies [i ];
50515055
50525056 if (depid <= AH -> maxDumpId && AH -> tocsByDumpId [depid ] != NULL &&
5053- ((strcmp (AH -> tocsByDumpId [depid ]-> desc , "TABLE DATA" ) == 0 ) ||
5054- strcmp (AH -> tocsByDumpId [depid ]-> desc , "TABLE" ) == 0 ))
5057+ (strcmp (AH -> tocsByDumpId [depid ]-> desc , "TABLE" ) == 0 ||
5058+ strcmp (AH -> tocsByDumpId [depid ]-> desc , "TABLE DATA" ) == 0 ||
5059+ strcmp (AH -> tocsByDumpId [depid ]-> desc , "PARTITIONED DATA" ) == 0 ))
50555060 lockids [nlockids ++ ] = depid ;
50565061 }
50575062
0 commit comments