Add patch to work with PostgreSQL 12

This commit is contained in:
jeremy 2020-02-06 00:40:06 +00:00
parent ed2ca02d38
commit 2ff6a7af52
2 changed files with 44 additions and 9 deletions

View File

@ -1,11 +1,11 @@
# $OpenBSD: Makefile,v 1.30 2019/07/12 20:44:02 sthen Exp $
# $OpenBSD: Makefile,v 1.31 2020/02/06 00:40:06 jeremy Exp $
COMMENT= PostgreSQL tools from Skype
# XXX outdated; http://pgfoundry.org/frs/download.php/3622/skytools-3.2.tar.gz
MODPY_EGG_VERSION= 3.1.1
DISTNAME= skytools-${MODPY_EGG_VERSION}
REVISION= 5
REVISION= 6
CATEGORIES= databases
@ -22,9 +22,9 @@ MASTER_SITES= https://github.com/downloads/markokr/skytools/
MODULES= lang/python
BUILD_DEPENDS= databases/postgresql,-server>11 \
databases/postgresql,-main>11
LIB_DEPENDS= databases/postgresql,-main
BUILD_DEPENDS= databases/postgresql,-server>=12 \
databases/postgresql,-main>=12
LIB_DEPENDS= databases/postgresql,-main>=12
RUN_DEPENDS= databases/py-psycopg2
NO_TEST= Yes

View File

@ -1,11 +1,18 @@
$OpenBSD: patch-sql_pgq_triggers_stringutil_c,v 1.1 2016/12/18 18:21:40 jeremy Exp $
$OpenBSD: patch-sql_pgq_triggers_stringutil_c,v 1.2 2020/02/06 00:40:06 jeremy Exp $
Fix build on PostgreSQL 9.6, patch taken from
https://github.com/markokr/skytools/pull/56
--- sql/pgq/triggers/stringutil.c.orig Tue Nov 1 04:28:50 2016
+++ sql/pgq/triggers/stringutil.c Tue Nov 1 04:28:53 2016
@@ -19,7 +19,11 @@
More fixes for PostgreSQL 12.
Index: sql/pgq/triggers/stringutil.c
--- sql/pgq/triggers/stringutil.c.orig
+++ sql/pgq/triggers/stringutil.c
@@ -16,10 +16,15 @@
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
+#include <strings.h>
#include <postgres.h>
#include <lib/stringinfo.h>
#include <mb/pg_wchar.h>
@ -17,3 +24,31 @@ https://github.com/markokr/skytools/pull/56
#include <utils/memutils.h>
#include "stringutil.h"
@@ -146,23 +151,10 @@ static int pgq_quote_literal(char *dst, const uint8 *s
/* check if ident is keyword that needs quoting */
static bool is_keyword(const char *ident)
{
- const ScanKeyword *kw;
-
- /* do the lookup */
-#if PG_VERSION_NUM >= 80500
- kw = ScanKeywordLookup(ident, ScanKeywords, NumScanKeywords);
-#else
- kw = ScanKeywordLookup(ident);
-#endif
-
- /* unreserved? */
-#if PG_VERSION_NUM >= 80300
- if (kw && kw->category == UNRESERVED_KEYWORD)
- return false;
-#endif
-
- /* found anything? */
- return kw != NULL;
+#define PG_KEYWORD(kwname, id, value) if(strcasecmp(kwname, ident) == 0) return true;
+#include <parser/kwlist.h>
+#undef PG_KEYWORD
+ return false;
}
/*