@@ -1988,12 +1988,14 @@ buildTocEntryArrays(ArchiveHandle *AH)
1988
1988
AH -> tocsByDumpId [te -> dumpId ] = te ;
1989
1989
1990
1990
/*
1991
- * tableDataId provides the TABLE DATA item's dump ID for each TABLE
1992
- * TOC entry that has a DATA item. We compute this by reversing the
1993
- * TABLE DATA item's dependency, knowing that a TABLE DATA item has
1994
- * just one dependency and it is the TABLE item.
1991
+ * tableDataId provides the DATA item's dump ID for each TABLE TOC
1992
+ * entry that has a TABLE DATA or PARTITIONED DATA item. We compute
1993
+ * this by reversing the DATA item's dependency, knowing that its
1994
+ * first dependency is the TABLE item.
1995
1995
*/
1996
- if (strcmp (te -> desc , "TABLE DATA" ) == 0 && te -> nDeps > 0 )
1996
+ if (te -> nDeps > 0 &&
1997
+ (strcmp (te -> desc , "TABLE DATA" ) == 0 ||
1998
+ strcmp (te -> desc , "PARTITIONED DATA" ) == 0 ))
1997
1999
{
1998
2000
DumpId tableId = te -> dependencies [0 ];
1999
2001
@@ -2003,7 +2005,7 @@ buildTocEntryArrays(ArchiveHandle *AH)
2003
2005
* item's dump ID, so there should be a place for it in the array.
2004
2006
*/
2005
2007
if (tableId <= 0 || tableId > maxDumpId )
2006
- pg_fatal ("bad table dumpId for TABLE DATA item" );
2008
+ pg_fatal ("bad table dumpId for %s item" , te -> desc );
2007
2009
2008
2010
AH -> tableDataId [tableId ] = te -> dumpId ;
2009
2011
}
@@ -3140,6 +3142,7 @@ _tocEntryRequired(TocEntry *te, teSection curSection, ArchiveHandle *AH)
3140
3142
{
3141
3143
if (strcmp (te -> desc , "TABLE" ) == 0 ||
3142
3144
strcmp (te -> desc , "TABLE DATA" ) == 0 ||
3145
+ strcmp (te -> desc , "PARTITIONED DATA" ) == 0 ||
3143
3146
strcmp (te -> desc , "VIEW" ) == 0 ||
3144
3147
strcmp (te -> desc , "FOREIGN TABLE" ) == 0 ||
3145
3148
strcmp (te -> desc , "MATERIALIZED VIEW" ) == 0 ||
@@ -3194,13 +3197,14 @@ _tocEntryRequired(TocEntry *te, teSection curSection, ArchiveHandle *AH)
3194
3197
if (!te -> hadDumper )
3195
3198
{
3196
3199
/*
3197
- * Special Case: If 'SEQUENCE SET' or anything to do with LOs, then it
3198
- * is considered a data entry. We don't need to check for BLOBS or
3199
- * old-style BLOB COMMENTS entries, because they will have hadDumper =
3200
- * true ... but we do need to check new-style BLOB ACLs, comments,
3201
- * etc.
3200
+ * Special Case: If 'PARTITIONED DATA', ' SEQUENCE SET' or anything to
3201
+ * do with LOs, then it is considered a data entry. We don't need to
3202
+ * check for BLOBS or old-style BLOB COMMENTS entries, because they
3203
+ * will have hadDumper = true ... but we do need to check new-style
3204
+ * BLOB ACLs, comments, etc.
3202
3205
*/
3203
- if (strcmp (te -> desc , "SEQUENCE SET" ) == 0 ||
3206
+ if (strcmp (te -> desc , "PARTITIONED DATA" ) == 0 ||
3207
+ strcmp (te -> desc , "SEQUENCE SET" ) == 0 ||
3204
3208
strcmp (te -> desc , "BLOB" ) == 0 ||
3205
3209
strcmp (te -> desc , "BLOB METADATA" ) == 0 ||
3206
3210
(strcmp (te -> desc , "ACL" ) == 0 &&
@@ -4996,14 +5000,14 @@ identify_locking_dependencies(ArchiveHandle *AH, TocEntry *te)
4996
5000
return ;
4997
5001
4998
5002
/*
4999
- * We assume the entry requires exclusive lock on each TABLE or TABLE DATA
5000
- * item listed among its dependencies. Originally all of these would have
5001
- * been TABLE items, but repoint_table_dependencies would have repointed
5002
- * them to the TABLE DATA items if those are present (which they might not
5003
- * be, eg in a schema-only dump). Note that all of the entries we are
5004
- * processing here are POST_DATA; otherwise there might be a significant
5005
- * difference between a dependency on a table and a dependency on its
5006
- * data, so that closer analysis would be needed here.
5003
+ * We assume the entry requires exclusive lock on each TABLE, TABLE DATA,
5004
+ * or PARTITIONED DATA item listed among its dependencies. Originally all
5005
+ * of these would have been TABLE items, but repoint_table_dependencies
5006
+ * would have repointed them to the DATA items if those are present (which
5007
+ * they might not be, eg in a schema-only dump). Note that all of the
5008
+ * entries we are processing here are POST_DATA; otherwise there might be
5009
+ * a significant difference between a dependency on a table and a
5010
+ * dependency on its data, so that closer analysis would be needed here.
5007
5011
*/
5008
5012
lockids = (DumpId * ) pg_malloc (te -> nDeps * sizeof (DumpId ));
5009
5013
nlockids = 0 ;
@@ -5012,8 +5016,9 @@ identify_locking_dependencies(ArchiveHandle *AH, TocEntry *te)
5012
5016
DumpId depid = te -> dependencies [i ];
5013
5017
5014
5018
if (depid <= AH -> maxDumpId && AH -> tocsByDumpId [depid ] != NULL &&
5015
- ((strcmp (AH -> tocsByDumpId [depid ]-> desc , "TABLE DATA" ) == 0 ) ||
5016
- strcmp (AH -> tocsByDumpId [depid ]-> desc , "TABLE" ) == 0 ))
5019
+ (strcmp (AH -> tocsByDumpId [depid ]-> desc , "TABLE" ) == 0 ||
5020
+ strcmp (AH -> tocsByDumpId [depid ]-> desc , "TABLE DATA" ) == 0 ||
5021
+ strcmp (AH -> tocsByDumpId [depid ]-> desc , "PARTITIONED DATA" ) == 0 ))
5017
5022
lockids [nlockids ++ ] = depid ;
5018
5023
}
5019
5024
0 commit comments