pg.ddx.io reorg/pg_repack GitHub issues and pull requests
help / color / mirror / Atom feedRe: [reorg/pg_repack] PR #494: Prevent operator shadowing in the repack.tables view
7+ messages / 2 participants
[nested] [flat]
* [reorg/pg_repack] PR #494: Prevent operator shadowing in the repack.tables view
@ 2026-11-14 22:55 "za-arthur (@za-arthur)" <noreply+za-arthur@github.com>
0 siblings, 0 replies; 7+ messages in thread
From: za-arthur (@za-arthur) @ 2026-11-14 22:55 UTC (permalink / raw)
To: reorg/pg_repack <noreply+reorg-pg_repack@github.com>
CREATE EXTENSION without `schema =` in the control file runs the install script with `search_path = <target schema>, pg_temp`. A role that can create objects in that schema can define operators whose argument types match better than the built-in ones, and the view binds to them when it is created.
Cast the integer constants to `pg_catalog.oid`, and use `OPERATOR(pg_catalog.!~~)` for the LIKE comparison so the lookup is limited to `pg_catalog`.
Follow up of https://github.com/reorg/pg_repack/pull/493
I accidentally pushed the commit 5c3233bb50823b630feba36e64f4e463c3ef04f8 into `master` 😞 , I reverted it and created the PR instead.
inline patch 1: lib/pg_repack.sql.in (+3/-3 lines) download inline-1.patch
diff --git a/lib/pg_repack.sql.in b/lib/pg_repack.sql.in
index 9bc94fc..f07b844 100644
--- a/lib/pg_repack.sql.in
+++ b/lib/pg_repack.sql.in
@@ -312,7 +312,7 @@ CREATE VIEW repack.tables AS
SELECT repack.oid2text(R.oid) AS relname,
R.oid AS relid,
R.reltoastrelid AS reltoastrelid,
- CASE WHEN R.reltoastrelid = 0 THEN 0 ELSE (
+ CASE WHEN R.reltoastrelid = 0::pg_catalog.oid THEN 0 ELSE (
SELECT indexrelid FROM pg_catalog.pg_index
WHERE indrelid = R.reltoastrelid
AND indisvalid) END AS reltoastidxid,
@@ -354,7 +354,7 @@ CREATE VIEW repack.tables AS
WHERE CKI.indisvalid
AND CKI.indexrelid = CKT.oid
AND CKI.indisclustered
- AND CKT.relam = 403) CK
+ AND CKT.relam = 403::pg_catalog.oid) CK
ON R.oid = CK.indrelid
LEFT JOIN pg_catalog.pg_namespace N ON N.oid = R.relnamespace
LEFT JOIN pg_catalog.pg_tablespace S ON S.oid = R.reltablespace
@@ -365,7 +365,7 @@ CREATE VIEW repack.tables AS
WHERE R.relkind = 'r'
AND R.relpersistence = 'p'
AND N.nspname NOT IN ('pg_catalog', 'information_schema')
- AND N.nspname NOT LIKE E'pg\\_temp\\_%';
+ AND N.nspname OPERATOR(pg_catalog.!~~) E'pg\\_temp\\_%';
CREATE FUNCTION repack.repack_indexdef(oid, oid, name, bool) RETURNS text AS
'MODULE_PATHNAME', 'repack_indexdef'
^ permalink raw [nested|flat] 7+ messages in thread
* Re: [reorg/pg_repack] PR #494: Prevent operator shadowing in the repack.tables view
@ 2026-11-14 22:55 ` "za-arthur (@za-arthur)" <noreply+za-arthur@github.com>
5 siblings, 0 replies; 7+ messages in thread
From: za-arthur (@za-arthur) @ 2026-11-14 22:55 UTC (permalink / raw)
To: reorg/pg_repack <noreply+reorg-pg_repack@github.com>
@za-arthur requested a review.
^ permalink raw [nested|flat] 7+ messages in thread
* Re: [reorg/pg_repack] PR #494: Prevent operator shadowing in the repack.tables view
@ 2026-11-14 22:55 ` "za-arthur (@za-arthur)" <noreply+za-arthur@github.com>
5 siblings, 0 replies; 7+ messages in thread
From: za-arthur (@za-arthur) @ 2026-11-14 22:55 UTC (permalink / raw)
To: reorg/pg_repack <noreply+reorg-pg_repack@github.com>
@za-arthur requested a review.
^ permalink raw [nested|flat] 7+ messages in thread
* Re: [reorg/pg_repack] PR #494 (approved): Prevent operator shadowing in the repack.tables view
@ 2026-11-14 23:10 ` "andreasscherbaum (@andreasscherbaum)" <noreply+andreasscherbaum@github.com>
5 siblings, 0 replies; 7+ messages in thread
From: andreasscherbaum (@andreasscherbaum) @ 2026-11-14 23:10 UTC (permalink / raw)
To: reorg/pg_repack <noreply+reorg-pg_repack@github.com>
^ permalink raw [nested|flat] 7+ messages in thread
* Re: [reorg/pg_repack] PR #494: Prevent operator shadowing in the repack.tables view
@ 2026-11-14 23:10 ` "andreasscherbaum (@andreasscherbaum)" <noreply+andreasscherbaum@github.com>
5 siblings, 0 replies; 7+ messages in thread
From: andreasscherbaum (@andreasscherbaum) @ 2026-11-14 23:10 UTC (permalink / raw)
To: reorg/pg_repack <noreply+reorg-pg_repack@github.com>
Maybe `master` can have a push restriction.
^ permalink raw [nested|flat] 7+ messages in thread
* Re: [reorg/pg_repack] PR #494: Prevent operator shadowing in the repack.tables view
@ 2026-11-14 23:21 ` "za-arthur (@za-arthur)" <noreply+za-arthur@github.com>
5 siblings, 0 replies; 7+ messages in thread
From: za-arthur (@za-arthur) @ 2026-11-14 23:21 UTC (permalink / raw)
To: reorg/pg_repack <noreply+reorg-pg_repack@github.com>
@za-arthur merged this (commit 69a949a4ad86).
^ permalink raw [nested|flat] 7+ messages in thread
* Re: [reorg/pg_repack] PR #494: Prevent operator shadowing in the repack.tables view
@ 2026-11-14 23:21 ` "za-arthur (@za-arthur)" <noreply+za-arthur@github.com>
5 siblings, 0 replies; 7+ messages in thread
From: za-arthur (@za-arthur) @ 2026-11-14 23:21 UTC (permalink / raw)
To: reorg/pg_repack <noreply+reorg-pg_repack@github.com>
@za-arthur closed this.
^ permalink raw [nested|flat] 7+ messages in thread
end of thread, other threads:[~2026-11-14 23:21 UTC | newest]
Thread overview: 7+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2026-11-14 22:55 [reorg/pg_repack] PR #494: Prevent operator shadowing in the repack.tables view "za-arthur (@za-arthur)" <noreply+za-arthur@github.com>
2026-11-14 22:55 ` "za-arthur (@za-arthur)" <noreply+za-arthur@github.com>
2026-11-14 22:55 ` "za-arthur (@za-arthur)" <noreply+za-arthur@github.com>
2026-11-14 23:10 ` Re: [reorg/pg_repack] PR #494 (approved): Prevent operator shadowing in the repack.tables view "andreasscherbaum (@andreasscherbaum)" <noreply+andreasscherbaum@github.com>
2026-11-14 23:10 ` "andreasscherbaum (@andreasscherbaum)" <noreply+andreasscherbaum@github.com>
2026-11-14 23:21 ` "za-arthur (@za-arthur)" <noreply+za-arthur@github.com>
2026-11-14 23:21 ` "za-arthur (@za-arthur)" <noreply+za-arthur@github.com>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox