Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 16 Aug 2019 18:09:24 +0000 (UTC)
From:      Sunpoet Po-Chuan Hsieh <sunpoet@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r509088 - head/databases/postgresql-plproxy/files
Message-ID:  <201908161809.x7GI9OhO024733@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: sunpoet
Date: Fri Aug 16 18:09:24 2019
New Revision: 509088
URL: https://svnweb.freebsd.org/changeset/ports/509088

Log:
  Fix build with PostgreSQL 10 and 11

Added:
  head/databases/postgresql-plproxy/files/
  head/databases/postgresql-plproxy/files/patch-src-cluster.c   (contents, props changed)
  head/databases/postgresql-plproxy/files/patch-src-execute.c   (contents, props changed)
  head/databases/postgresql-plproxy/files/patch-src-function.c   (contents, props changed)

Added: head/databases/postgresql-plproxy/files/patch-src-cluster.c
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/databases/postgresql-plproxy/files/patch-src-cluster.c	Fri Aug 16 18:09:24 2019	(r509088)
@@ -0,0 +1,26 @@
+--- src/cluster.c.orig	2017-10-08 08:53:35 UTC
++++ src/cluster.c
+@@ -588,7 +588,11 @@ reload_sqlmed_user(ProxyFunction *func, 
+ 	 */
+ 	aclresult = pg_foreign_server_aclcheck(um->serverid, um->userid, ACL_USAGE);
+ 	if (aclresult != ACLCHECK_OK)
++#if PG_VERSION_NUM >= 110000
++		aclcheck_error(aclresult, OBJECT_FOREIGN_SERVER, cluster->name);
++#else
+ 		aclcheck_error(aclresult, ACL_KIND_FOREIGN_SERVER, cluster->name);
++#endif
+ 
+ 	/* Extract the common connect string elements from user mapping */
+ 	got_user = false;
+@@ -657,7 +661,11 @@ reload_sqlmed_cluster(ProxyFunction *fun
+ 	 */
+ 	aclresult = pg_foreign_server_aclcheck(foreign_server->serverid, info->user_oid, ACL_USAGE);
+ 	if (aclresult != ACLCHECK_OK)
++#if PG_VERSION_NUM >= 110000
++		aclcheck_error(aclresult, OBJECT_FOREIGN_SERVER, foreign_server->servername);
++#else
+ 		aclcheck_error(aclresult, ACL_KIND_FOREIGN_SERVER, foreign_server->servername);
++#endif
+ 
+ 	/* drop old config values */
+ 	clear_config(&cluster->config);

Added: head/databases/postgresql-plproxy/files/patch-src-execute.c
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/databases/postgresql-plproxy/files/patch-src-execute.c	Fri Aug 16 18:09:24 2019	(r509088)
@@ -0,0 +1,29 @@
+HAVE_NETINET_IN_H and HAVE_SYS_SOCKET_H were removed from pg_config.h in PostgreSQL 10
+HAVE_NETINET_TCP_H was removed from pg_config.h in PostgreSQL 11
+
+--- src/execute.c.orig	2017-10-08 08:53:35 UTC
++++ src/execute.c
+@@ -28,6 +28,7 @@
+ #include "plproxy.h"
+ 
+ #include <sys/time.h>
++#include <sys/types.h>
+ 
+ #include "poll_compat.h"
+ 
+@@ -35,15 +36,9 @@
+ #include <winsock2.h>
+ #include <ws2tcpip.h>
+ #endif
+-#ifdef HAVE_SYS_SOCKET_H
+ #include <sys/socket.h>
+-#endif
+-#ifdef HAVE_NETINET_IN_H
+ #include <netinet/in.h>
+-#endif
+-#ifdef HAVE_NETINET_TCP_H
+ #include <netinet/tcp.h>
+-#endif
+ #ifdef HAVE_ARPA_INET_H
+ #include <arpa/inet.h>
+ #endif

Added: head/databases/postgresql-plproxy/files/patch-src-function.c
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/databases/postgresql-plproxy/files/patch-src-function.c	Fri Aug 16 18:09:24 2019	(r509088)
@@ -0,0 +1,16 @@
+--- src/function.c.orig	2017-10-08 08:53:35 UTC
++++ src/function.c
+@@ -214,8 +214,13 @@ fn_returns_dynamic_record(HeapTuple proc
+ 	Form_pg_proc proc_struct;
+ 	proc_struct = (Form_pg_proc) GETSTRUCT(proc_tuple);
+ 	if (proc_struct->prorettype == RECORDOID
++#if PG_VERSION_NUM >= 110000
++		&& (heap_attisnull(proc_tuple, Anum_pg_proc_proargmodes, NULL)
++		    || heap_attisnull(proc_tuple, Anum_pg_proc_proargnames, NULL)))
++#else
+ 		&& (heap_attisnull(proc_tuple, Anum_pg_proc_proargmodes)
+ 		    || heap_attisnull(proc_tuple, Anum_pg_proc_proargnames)))
++#endif
+ 		return true;
+ 	return false;
+ }



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201908161809.x7GI9OhO024733>