From 40788c11f29171d12a9ec910d22dc593d5f8dde3 Mon Sep 17 00:00:00 2001 From: Chapman Flack Date: Sun, 20 Aug 2023 20:32:46 -0400 Subject: [PATCH 1/3] Assume dlfcn.h exists except on Windows postgres/postgres@ca1e855 --- pljava-so/src/main/c/Backend.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pljava-so/src/main/c/Backend.c b/pljava-so/src/main/c/Backend.c index 287652fd2..9c60e5c73 100644 --- a/pljava-so/src/main/c/Backend.c +++ b/pljava-so/src/main/c/Backend.c @@ -28,7 +28,7 @@ #include #if PG_VERSION_NUM >= 120000 - #ifdef HAVE_DLOPEN + #if defined(HAVE_DLOPEN) || PG_VERSION_NUM >= 160000 && ! defined(WIN32) #include #endif #define pg_dlopen(f) dlopen((f), RTLD_NOW | RTLD_GLOBAL) From 2511321530cf1ccdb0e4a95cdf35ab8a64c40f78 Mon Sep 17 00:00:00 2001 From: Chapman Flack Date: Sun, 20 Aug 2023 20:41:35 -0400 Subject: [PATCH 2/3] Rely on __func__ being supported postgres/postgres@320f92b --- pljava-so/src/main/c/Function.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pljava-so/src/main/c/Function.c b/pljava-so/src/main/c/Function.c index a46c0e6dd..f975fbe56 100644 --- a/pljava-so/src/main/c/Function.c +++ b/pljava-so/src/main/c/Function.c @@ -34,6 +34,10 @@ #include #include +#if PG_VERSION_NUM >= 160000 +#define PG_FUNCNAME_MACRO __func__ +#endif + #ifdef _MSC_VER # define strcasecmp _stricmp # define strncasecmp _strnicmp From e004f0a25e0b8e503c0c2377ade9def969aff48b Mon Sep 17 00:00:00 2001 From: Chapman Flack Date: Tue, 22 Aug 2023 16:24:29 -0400 Subject: [PATCH 3/3] Upstream has refactored aclcheck functions postgres/postgres@c727f51 --- pljava-so/src/main/c/Function.c | 2 +- pljava-so/src/main/c/type/AclId.c | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/pljava-so/src/main/c/Function.c b/pljava-so/src/main/c/Function.c index f975fbe56..3a2bd5b10 100644 --- a/pljava-so/src/main/c/Function.c +++ b/pljava-so/src/main/c/Function.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004-2022 Tada AB and other contributors, as listed below. + * Copyright (c) 2004-2023 Tada AB and other contributors, as listed below. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the The BSD 3-Clause License diff --git a/pljava-so/src/main/c/type/AclId.c b/pljava-so/src/main/c/type/AclId.c index 504b8cf6a..81b31538d 100644 --- a/pljava-so/src/main/c/type/AclId.c +++ b/pljava-so/src/main/c/type/AclId.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004-2019 Tada AB and other contributors, as listed below. + * Copyright (c) 2004-2023 Tada AB and other contributors, as listed below. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the The BSD 3-Clause License @@ -22,6 +22,12 @@ #include "org_postgresql_pljava_internal_AclId.h" #include "pljava/Exception.h" +#if PG_VERSION_NUM >= 160000 +#include +#define pg_namespace_aclcheck(oid,rid,mode) \ + object_aclcheck(NamespaceRelationId, (oid), (rid), (mode)) +#endif + static jclass s_AclId_class; static jmethodID s_AclId_init; static jfieldID s_AclId_m_native;