From: ritojoao (@ritojoao) <noreply+ritojoao@github.com>
To: reorg/pg_repack <noreply+reorg-pg_repack@github.com>
Subject: Re: [reorg/pg_repack] PR #493: Use format() and pg_catalog-qualified catalog tables in pg_repack.sql.in
Date: Thu, 12 Nov 2026 22:56:02 +0000
Message-ID: <gh-reorg-pg_repack-493-c6838227215@github.com> (raw)
In-Reply-To: <gh-reorg-pg_repack-493@github.com>
References: <gh-reorg-pg_repack-493@github.com>
Thank you, @za-arthur. Before you merge, I found one regression in this PR that I think should be fixed first.
When the primary key type lives in `public` (I tested `hstore` installed in `public`), pg_repack works on master but fails with this PR if there are concurrent UPDATEs or DELETEs during the run:
```
ERROR: operator does not exist: public.hstore = public.hstore
```
The cause is the new `SET search_path = pg_catalog, pg_temp` on `repack_apply()`. The `=` in the generated `WHERE (id) = ($1.id)` no longer finds the operator in `public`. It is the same root cause as your first follow-up (extension in another schema), which also fails on master when I call `repack_apply()` by hand.
I tested a fix in `get_compare_pkey()`. It builds `col OPERATOR(schema.=) $N.col` from the btree equality operator of the index opclass. On PG 16 it fixes both cases with a manual `repack_apply()` call, and it fixes the `public` case in a full pg_repack run with concurrent writes. `make installcheck` still passes. The current tests do not cover this, so I will add a regression test and check more PostgreSQL versions.
Would you like me to push the fix to this PR, or keep this PR as it is and send the fix as a separate PR?