@@ -96,8 +96,9 @@ static LogicalDecodingContext *setup_decoding(Oid relid, TupleDesc tup_desc,
96
96
Snapshot * snap_hist );
97
97
static void decoding_cleanup (LogicalDecodingContext * ctx );
98
98
static CatalogState * get_catalog_state (Oid relid );
99
- static void get_pg_class_info (Oid relid , TransactionId * xmin ,
100
- Form_pg_class * form_p , TupleDesc * desc_p );
99
+ static void get_pg_class_info (Oid relid , bool is_composite_type ,
100
+ TransactionId * xmin , Form_pg_class * form_p ,
101
+ TupleDesc * desc_p );
101
102
static void get_attribute_info (Oid relid , int relnatts ,
102
103
TransactionId * * xmins_p ,
103
104
CatalogState * cat_state );
@@ -1119,7 +1120,7 @@ get_catalog_state(Oid relid)
1119
1120
* turned off and on. On the other hand it might restrict some concurrent
1120
1121
* DDLs that would be safe as such.
1121
1122
*/
1122
- get_pg_class_info (relid , & result -> rel .xmin , & result -> form_class ,
1123
+ get_pg_class_info (relid , false, & result -> rel .xmin , & result -> form_class ,
1123
1124
& result -> desc_class );
1124
1125
1125
1126
result -> rel .relnatts = result -> form_class -> relnatts ;
@@ -1149,8 +1150,8 @@ get_catalog_state(Oid relid)
1149
1150
* pointers are passed.
1150
1151
*/
1151
1152
static void
1152
- get_pg_class_info (Oid relid , TransactionId * xmin , Form_pg_class * form_p ,
1153
- TupleDesc * desc_p )
1153
+ get_pg_class_info (Oid relid , bool is_composite_type , TransactionId * xmin ,
1154
+ Form_pg_class * form_p , TupleDesc * desc_p )
1154
1155
{
1155
1156
HeapTuple tuple ;
1156
1157
Form_pg_class form_class ;
@@ -1185,7 +1186,7 @@ get_pg_class_info(Oid relid, TransactionId *xmin, Form_pg_class *form_p,
1185
1186
1186
1187
/* Invalid relfilenode indicates mapped relation. */
1187
1188
form_class = (Form_pg_class ) GETSTRUCT (tuple );
1188
- if (form_class -> relfilenode == InvalidOid )
1189
+ if (form_class -> relfilenode == InvalidOid && ! is_composite_type )
1189
1190
ereport (ERROR ,
1190
1191
(errcode (ERRCODE_WRONG_OBJECT_TYPE ),
1191
1192
(errmsg ("Mapped relation cannot be squeezed" ))));
@@ -1366,8 +1367,8 @@ get_composite_type_info(TypeCatInfo *tinfo)
1366
1367
* as the corresponding pg_attribute tuples.
1367
1368
*/
1368
1369
tinfo -> rel .relid = form_type -> typrelid ;
1369
- get_pg_class_info (form_type -> typrelid , & tinfo -> rel .xmin , & form_class ,
1370
- NULL );
1370
+ get_pg_class_info (form_type -> typrelid , true, & tinfo -> rel .xmin ,
1371
+ & form_class , NULL );
1371
1372
if (form_class -> relnatts > 0 )
1372
1373
get_attribute_info (form_type -> typrelid , form_class -> relnatts ,
1373
1374
& tinfo -> rel .attr_xmins , NULL );
@@ -1636,7 +1637,7 @@ check_pg_class_changes(CatalogState *cat_state)
1636
1637
{
1637
1638
TransactionId xmin_current ;
1638
1639
1639
- get_pg_class_info (cat_state -> rel .relid , & xmin_current , NULL , NULL );
1640
+ get_pg_class_info (cat_state -> rel .relid , false, & xmin_current , NULL , NULL );
1640
1641
1641
1642
/*
1642
1643
* Check if pg_class(xmin) has changed.
0 commit comments