Skip to content

Commit

Permalink
Add toasts to ENR for temp tables
Browse files Browse the repository at this point in the history
  • Loading branch information
timchang514 committed Jan 25, 2024
1 parent 2e7abaf commit 8926425
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/backend/catalog/pg_depend.c
Original file line number Diff line number Diff line change
Expand Up @@ -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++;
}

Expand Down
2 changes: 2 additions & 0 deletions src/backend/catalog/toasting.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 8926425

Please sign in to comment.