Skip to content

Commit d1ab1f7

Browse files
committed
Check "relkind" instead of "reltype" in pg_class for clarity.
1 parent 27ea0fa commit d1ab1f7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/repack.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1221,9 +1221,9 @@ repack_index_swap(PG_FUNCTION_ARGS)
12211221

12221222
initStringInfo(&str);
12231223

1224-
/* Find the OID of our new index. Indexes should have a reltype of 0. */
1224+
/* Find the OID of our new index. */
12251225
appendStringInfo(&str, "SELECT oid FROM pg_class "
1226-
"WHERE relname = 'index_%u' AND reltype = 0",
1226+
"WHERE relname = 'index_%u' AND relkind = 'i'",
12271227
orig_idx_oid);
12281228
execute(SPI_OK_SELECT, str.data);
12291229
if (SPI_processed != 1)

0 commit comments

Comments
 (0)