Check "relkind" instead of "reltype" in pg_class for clarity.

This commit is contained in:
Josh Kupershmidt 2013-07-08 09:20:40 -04:00
parent 27ea0fabe4
commit d1ab1f7882

View File

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