aboutsummaryrefslogtreecommitdiff
path: root/src/backend/commands/tablecmds.c
diff options
context:
space:
mode:
authorRobert Haas <rhaas@postgresql.org>2021-03-19 17:17:48 -0400
committerRobert Haas <rhaas@postgresql.org>2021-03-19 17:17:48 -0400
commitd00fbdc431192c3e429b3e91c43d364e5c7ba680 (patch)
treef5d6efc7823e618cb6c93f20235cc94ed7409792 /src/backend/commands/tablecmds.c
parentbbe0a81db69bd10bd166907c3701492a29aca294 (diff)
downloadpostgresql-d00fbdc431192c3e429b3e91c43d364e5c7ba680.tar.gz
postgresql-d00fbdc431192c3e429b3e91c43d364e5c7ba680.zip
Fix use-after-ReleaseSysCache problem in ATExecAlterColumnType.
Introduced by commit bbe0a81db69bd10bd166907c3701492a29aca294. Per buildfarm member prion.
Diffstat (limited to 'src/backend/commands/tablecmds.c')
-rw-r--r--src/backend/commands/tablecmds.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/backend/commands/tablecmds.c b/src/backend/commands/tablecmds.c
index ab89935ba73..9b2800bf5e2 100644
--- a/src/backend/commands/tablecmds.c
+++ b/src/backend/commands/tablecmds.c
@@ -11953,8 +11953,6 @@ ATExecAlterColumnType(AlteredTableInfo *tab, Relation rel,
attTup->attalign = tform->typalign;
attTup->attstorage = tform->typstorage;
- ReleaseSysCache(typeTuple);
-
/* Setup attribute compression */
if (rel->rd_rel->relkind == RELKIND_RELATION ||
rel->rd_rel->relkind == RELKIND_PARTITIONED_TABLE)
@@ -11972,6 +11970,8 @@ ATExecAlterColumnType(AlteredTableInfo *tab, Relation rel,
else
attTup->attcompression = InvalidCompressionMethod;
+ ReleaseSysCache(typeTuple);
+
CatalogTupleUpdate(attrelation, &heapTup->t_self, heapTup);
table_close(attrelation, RowExclusiveLock);