Skip to content

Commit 39b0c76

Browse files
committed
Record the proper typmod for an index expression column.
We should use exprTypmod() to extract the typmod of the expression, instead of just blindly storing -1. This seems to have been an aboriginal oversight in commit fc8d970 which introduced general-expression indexes. The consequences are only cosmetic at present, since the index machinery doesn't really look at typmod for index columns; but still it seems best to describe the column type as precisely as we can. Per off-list complaint from Thomas Fanghaenel.
1 parent 4bfc5f1 commit 39b0c76

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/backend/catalog/index.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -389,7 +389,7 @@ ConstructTupleDescriptor(Relation heapRelation,
389389
to->attalign = typeTup->typalign;
390390
to->attstattarget = -1;
391391
to->attcacheoff = -1;
392-
to->atttypmod = -1;
392+
to->atttypmod = exprTypmod(indexkey);
393393
to->attislocal = true;
394394
to->attcollation = collationObjectId[i];
395395

0 commit comments

Comments
 (0)