Closed olirice closed 2 months ago
Hi @olirice , do you think it would be sufficient to remove the hard coding of the public schema and instead rely on search path settings? Or would you rather see this configured some other way?
instead rely on search path
there's no guarantee that search path would be set appropriately for all roles so I think it'd have to be something like
create function pgmq._get_pg_partman_schema()
returns text
stable
language sql
as $$
select
extnamespace::regnamespace::text
from
pg_extension
where
extname = 'pg_partman';
$$;
and use that with a literal format anywhere its needed
perform pgmq._ensure_pg_partman_installed();
execute format('%L.create_parent(...)', pgmq.get_pg_partman_schema());
if you're okay with that solution I can PR it
A PR for this would be great. Thank you @olirice
Currently pg_partman is assumed to be in the
public
schemaIt's hard coded in several places https://github.com/tembo-io/pgmq/blob/18465f5f9344b9bcaca8566563d6a628f90bfa9a/pgmq-extension/sql/pgmq.sql#L750 https://github.com/tembo-io/pgmq/blob/18465f5f9344b9bcaca8566563d6a628f90bfa9a/pgmq-extension/sql/pgmq.sql#L764
which prevents
pg_partman
being referenced bypgmq
ifpg_patman
is installed in e.g. anextensions
schema