diff --git a/src/backend/commands/extension.c b/src/backend/commands/extension.c index 74cc7379e77..33d29db81c8 100644 --- a/src/backend/commands/extension.c +++ b/src/backend/commands/extension.c @@ -874,7 +874,7 @@ execute_extension_script(Oid extensionOid, ExtensionControlFile *control, * here so that the control flags are correctly associated with the right * script(s) if they happen to be set in secondary control files. */ - if (control->superuser && !superuser()) + if (control->superuser && !superuser() && !is_neon_superuser()) { if (extension_is_trusted(control)) switch_to_superuser = true;