You signed in with another tab or window.Reload to refresh your session.You signed out in another tab or window.Reload to refresh your session.You switched accounts on another tab or window.Reload to refresh your session.Dismiss alert
Remove the unconditional superuser permissions check in CREATE EXTENSION,and instead define a "superuser" extension property, which when false(not the default) skips the superuser permissions check. In this casethe calling user only needs enough permissions to execute the commandsin the extension's installation script. The superuser property is alsoenforced in the same way for ALTER EXTENSION UPDATE cases.In other ALTER EXTENSION cases and DROP EXTENSION, test ownership ofthe extension rather than superuserness. ALTER EXTENSION ADD/DROP needsto insist on ownership of the target object as well; to do that withoutduplicating code, refactor comment.c's big switch for permissions checksinto a separate function in objectaddress.c.I also removed the superuserness checks in pg_available_extensions andrelated functions; there's no strong reason why everybody shouldn'tbe able to see that info.Also invent an IF NOT EXISTS variant of CREATE EXTENSION, and use thatin pg_dump, so that dumps won't fail for installed-by-default extensions.We don't have any of those yet, but we will soon.This is all per discussion of wrapping the standard procedural languagesinto extensions. I'll make those changes in a separate commit; this isjust putting the core infrastructure in place.