Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when dropping another extension #90

Open
MichaelDBA opened this issue Jan 15, 2025 · 2 comments
Open

Error when dropping another extension #90

MichaelDBA opened this issue Jan 15, 2025 · 2 comments
Assignees
Labels

Comments

@MichaelDBA
Copy link

MichaelDBA commented Jan 15, 2025

I have installed the pg_index_stats extension on the same PostgreSQL v16 host where I previously installed the powa extension.
When I try to drop the pg_index_stats extension, I get this error:

ERROR: column pe.module does not exist
LINE 10: JOIN src ON pe.module = src.object_name
^
QUERY: WITH src AS (
SELECT object_name
FROM pg_event_trigger_dropped_objects() d
WHERE d.object_type = 'extension'
)
SELECT CASE external
WHEN true THEN quote_ident(nsp.nspname)
ELSE 'public'
END AS schema, function_name AS funcname FROM public.powa_extensions AS pe
JOIN src ON pe.module = src.object_name
LEFT JOIN pg_extension AS ext ON ext.extname = pe.extname
LEFT JOIN pg_namespace AS nsp ON nsp.oid = ext.extnamespace
WHERE operation = 'unregister'
ORDER BY module
CONTEXT: PL/pgSQL function public.powa_check_dropped_extensions() line 11 at SQL statement

Seems the powa extension is hindering the dropping of the pg_index_stats extension. I installed powa through the binary download for PG16 in PGDG.

@rjuju
Copy link
Member

rjuju commented Jan 15, 2025

Hi

Indeed that's a bug in powa. Powa creates an event trigger to automatically register/unregister supported extensions when they're created or dropped, and this got broken with v5 unfortunately. It's not really doing this on purpose, it's just that any error happening there simply cancels the outside query.

Sorry about that, I will fix it soon and it will be available in the next minor version of powa. In the meantime you could manually edit the powa_check_dropped_extensions function and simply remove all the code between the most external BEGIN and END.

@MichaelDBA
Copy link
Author

Thank you for your speedy attention!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants