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; diff --git a/src/backend/commands/functioncmds.c b/src/backend/commands/functioncmds.c index 00a6d282cfd..2b2429bc18d 100644 --- a/src/backend/commands/functioncmds.c +++ b/src/backend/commands/functioncmds.c @@ -1125,7 +1125,7 @@ CreateFunction(ParseState *pstate, CreateFunctionStmt *stmt) else { /* if untrusted language, must be superuser */ - if (!superuser()) + if (!(superuser() || (is_neon_superuser() && creating_extension))) aclcheck_error(ACLCHECK_NO_PRIV, OBJECT_LANGUAGE, NameStr(languageStruct->lanname)); } @@ -2129,7 +2129,7 @@ ExecuteDoStmt(ParseState *pstate, DoStmt *stmt, bool atomic) else { /* if untrusted language, must be superuser */ - if (!superuser()) + if (!(superuser() || (is_neon_superuser() && creating_extension))) aclcheck_error(ACLCHECK_NO_PRIV, OBJECT_LANGUAGE, NameStr(languageStruct->lanname)); } diff --git a/src/backend/replication/logical/origin.c b/src/backend/replication/logical/origin.c index c9a077ba8be..6ce6252951d 100644 --- a/src/backend/replication/logical/origin.c +++ b/src/backend/replication/logical/origin.c @@ -676,7 +676,7 @@ CheckPointReplicationOrigin(void) chkp_size += sizeof(crc); /* NEON specific: persist snapshot in storage using logical message */ - LogLogicalMessage("neon-file:pg_logical/replorigin_checkpoint", buf, chkp_size, false); + XLogFlush(LogLogicalMessage("neon-file:pg_logical/replorigin_checkpoint", buf, chkp_size, false)); } pfree(buf); diff --git a/src/backend/replication/logical/snapbuild.c b/src/backend/replication/logical/snapbuild.c index 53b72310139..be7624ec203 100644 --- a/src/backend/replication/logical/snapbuild.c +++ b/src/backend/replication/logical/snapbuild.c @@ -1737,7 +1737,7 @@ SnapBuildSerialize(SnapBuild *builder, XLogRecPtr lsn) /* NEON specific: persist snapshot in storage using logical message */ snprintf(prefix, sizeof(prefix), "neon-file:%s", path); - LogLogicalMessage(prefix, (char*)ondisk, needed_length, false); + XLogFlush(LogLogicalMessage(prefix, (char*)ondisk, needed_length, false)); errno = 0; pgstat_report_wait_start(WAIT_EVENT_SNAPBUILD_WRITE); @@ -2106,7 +2106,7 @@ CheckPointSnapBuild(void) /* NEON specific: delete file from storage using logical message */ snprintf(prefix, sizeof(prefix), "neon-file:%s", path); - LogLogicalMessage(prefix, NULL, 0, false); + XLogFlush(LogLogicalMessage(prefix, NULL, 0, false)); /* * It's not particularly harmful, though strange, if we can't diff --git a/src/backend/storage/ipc/dsm_impl.c b/src/backend/storage/ipc/dsm_impl.c index 340048a0d1e..77a195b4836 100644 --- a/src/backend/storage/ipc/dsm_impl.c +++ b/src/backend/storage/ipc/dsm_impl.c @@ -880,7 +880,7 @@ dsm_impl_mmap(dsm_op op, dsm_handle handle, Size request_size, * transferring data to the kernel. */ char *zbuffer = (char *) palloc0(ZBUFFER_SIZE); - uint32 remaining = request_size; + Size remaining = request_size; bool success = true; /*