diff --git a/src/backend/catalog/pg_depend.c b/src/backend/catalog/pg_depend.c index 89bbb5c9e48..9afaaf4e3b0 100644 --- a/src/backend/catalog/pg_depend.c +++ b/src/backend/catalog/pg_depend.c @@ -326,7 +326,8 @@ deleteDependencyRecordsFor(Oid classId, Oid objectId, ((Form_pg_depend) GETSTRUCT(tup))->deptype == DEPENDENCY_EXTENSION) continue; - CatalogTupleDelete(depRel, &tup->t_self); + if (!ENRdropTuple(depRel, tup)) + CatalogTupleDelete(depRel, &tup->t_self); count++; } diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c index cf419a6962c..d726088c8ec 100644 --- a/src/backend/catalog/toasting.c +++ b/src/backend/catalog/toasting.c @@ -200,6 +200,8 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid, */ if (sql_dialect == SQL_DIALECT_TSQL && RelationIsBBFTableVariable(rel)) pg_toast_prefix = "@pg_toast"; + else if (sql_dialect == SQL_DIALECT_TSQL && rel->rd_rel->relpersistence == RELPERSISTENCE_TEMP && get_ENR_withoid(currentQueryEnv, rel->rd_id, ENR_TSQL_TEMP)) + pg_toast_prefix = "#pg_toast"; snprintf(toast_relname, sizeof(toast_relname), "%s_%u", pg_toast_prefix, relOid);