diff -Nru pgextwlist-1.5/debian/changelog pgextwlist-1.6/debian/changelog --- pgextwlist-1.5/debian/changelog 2016-09-27 16:39:03.000000000 +0000 +++ pgextwlist-1.6/debian/changelog 2017-11-22 03:24:36.000000000 +0000 @@ -1,3 +1,11 @@ +pgextwlist (1.6-1) unstable; urgency=medium + + * New upstream version with PostgreSQL 10 support, patch by + Oskari Saarenmaa. (Closes: #876851) + * Update Dimitri's email address. + + -- Christoph Berg Sun, 15 Oct 2017 13:21:54 +0200 + pgextwlist (1.5-1) unstable; urgency=medium * New upstream version with 9.6 support. diff -Nru pgextwlist-1.5/debian/control pgextwlist-1.6/debian/control --- pgextwlist-1.5/debian/control 2016-09-27 16:39:03.000000000 +0000 +++ pgextwlist-1.6/debian/control 2017-11-22 03:24:36.000000000 +0000 @@ -1,19 +1,19 @@ Source: pgextwlist -Priority: extra +Priority: optional Maintainer: Debian PostgreSQL Maintainers -Uploaders: Dimitri Fontaine , Christoph Berg +Uploaders: Dimitri Fontaine , Christoph Berg Build-Depends: debhelper (>= 9), postgresql-server-dev-all (>= 171~) -Standards-Version: 3.9.8 +Standards-Version: 4.1.1 Section: database Homepage: https://github.com/dimitri/pgextwlist Vcs-Git: https://github.com/dimitri/pgextwlist.git Vcs-Browser: https://github.com/dimitri/pgextwlist XS-Testsuite: autopkgtest -Package: postgresql-9.6-pgextwlist +Package: postgresql-10-pgextwlist Section: libs Architecture: any -Depends: ${shlibs:Depends}, ${misc:Depends}, postgresql-9.6 +Depends: ${shlibs:Depends}, ${misc:Depends}, postgresql-10 Description: PostgreSQL Extension Whitelisting This extension implements extension whitelisting, and will actively prevent users from installing extensions not in the provided list. Also, this diff -Nru pgextwlist-1.5/debian/control.in pgextwlist-1.6/debian/control.in --- pgextwlist-1.5/debian/control.in 2016-09-27 16:39:03.000000000 +0000 +++ pgextwlist-1.6/debian/control.in 2017-11-22 03:24:36.000000000 +0000 @@ -1,9 +1,9 @@ Source: pgextwlist -Priority: extra +Priority: optional Maintainer: Debian PostgreSQL Maintainers -Uploaders: Dimitri Fontaine , Christoph Berg +Uploaders: Dimitri Fontaine , Christoph Berg Build-Depends: debhelper (>= 9), postgresql-server-dev-all (>= 171~) -Standards-Version: 3.9.8 +Standards-Version: 4.1.1 Section: database Homepage: https://github.com/dimitri/pgextwlist Vcs-Git: https://github.com/dimitri/pgextwlist.git diff -Nru pgextwlist-1.5/debian/source/format pgextwlist-1.6/debian/source/format --- pgextwlist-1.5/debian/source/format 2014-02-03 17:14:28.000000000 +0000 +++ pgextwlist-1.6/debian/source/format 2017-10-15 12:39:40.000000000 +0000 @@ -1 +1 @@ -3.0 (quilt) +1.0 diff -Nru pgextwlist-1.5/debian/tests/control pgextwlist-1.6/debian/tests/control --- pgextwlist-1.5/debian/tests/control 2016-09-27 16:39:03.000000000 +0000 +++ pgextwlist-1.6/debian/tests/control 2017-11-22 03:24:36.000000000 +0000 @@ -1,3 +1,3 @@ -Depends: @, postgresql-server-dev-all, postgresql-contrib-9.6 +Depends: @, postgresql-server-dev-all, postgresql-contrib-10 Tests: installcheck Restrictions: allow-stderr diff -Nru pgextwlist-1.5/Makefile pgextwlist-1.6/Makefile --- pgextwlist-1.5/Makefile 2016-09-27 16:47:05.000000000 +0000 +++ pgextwlist-1.6/Makefile 2017-10-15 12:39:40.000000000 +0000 @@ -1,4 +1,4 @@ -short_ver = 1.5 +short_ver = 1.6 long_ver = $(shell (git describe --tags --long '--match=v*' 2>/dev/null || echo $(short_ver)-0-unknown) | cut -c2-) MODULE_big = pgextwlist diff -Nru pgextwlist-1.5/pgextwlist.c pgextwlist-1.6/pgextwlist.c --- pgextwlist-1.5/pgextwlist.c 2016-09-27 16:47:05.000000000 +0000 +++ pgextwlist-1.6/pgextwlist.c 2017-10-15 12:39:40.000000000 +0000 @@ -30,7 +30,11 @@ #include "commands/dbcommands.h" #include "commands/seclabel.h" #include "commands/user.h" +#if PG_MAJOR_VERSION >= 1000 +#include "common/md5.h" +#else #include "libpq/md5.h" +#endif #include "funcapi.h" #include "miscadmin.h" #include "storage/lmgr.h" @@ -43,6 +47,9 @@ #include "utils/syscache.h" #include "utils/timestamp.h" #include "utils/tqual.h" +#if PG_MAJOR_VERSION >= 1000 +#include "utils/varlena.h" +#endif /* #define DEBUG @@ -71,7 +78,7 @@ #define PROCESS_UTILITY_ARGS parsetree, queryString, params, \ isTopLevel, dest, completionTag -#else +#elif PG_MAJOR_VERSION < 1000 #define PROCESS_UTILITY_PROTO_ARGS Node *parsetree, \ const char *queryString, \ ProcessUtilityContext context, \ @@ -81,6 +88,17 @@ #define PROCESS_UTILITY_ARGS parsetree, queryString, context, \ params, dest, completionTag +#else +#define PROCESS_UTILITY_PROTO_ARGS PlannedStmt *pstmt, \ + const char *queryString, \ + ProcessUtilityContext context, \ + ParamListInfo params, \ + QueryEnvironment *queryEnv, \ + DestReceiver *dest, \ + char *completionTag + +#define PROCESS_UTILITY_ARGS pstmt, queryString, context, \ + params, queryEnv, dest, completionTag #endif /* PG_MAJOR_VERSION */ #define EREPORT_EXTENSION_IS_NOT_WHITELISTED(op) \ @@ -256,6 +274,10 @@ char *old_version = NULL; char *new_version = NULL; +#if PG_MAJOR_VERSION >= 1000 + Node *parsetree = pstmt->utilityStmt; +#endif + /* Don't try to make life hard for our friendly superusers. */ if (superuser()) { @@ -318,7 +340,11 @@ */ bool whitelisted = false; List *objname = lfirst(lc); +#if PG_MAJOR_VERSION < 1000 name = strVal(linitial(objname)); +#else + name = strVal((Value *) objname); +#endif whitelisted = extension_is_whitelisted(name); all_in_whitelist = all_in_whitelist && whitelisted; @@ -341,7 +367,7 @@ } break; - /* We intentionnaly don't support that command. */ + /* We intentionally don't support that command. */ case T_AlterExtensionContentsStmt: default: break; diff -Nru pgextwlist-1.5/pgextwlist.spec pgextwlist-1.6/pgextwlist.spec --- pgextwlist-1.5/pgextwlist.spec 2016-09-27 16:47:05.000000000 +0000 +++ pgextwlist-1.6/pgextwlist.spec 2017-10-15 12:39:40.000000000 +0000 @@ -36,6 +36,8 @@ %{?pkglibdir}%{!?pkglibdir:%{_libdir}/pgsql}/pgextwlist.so %changelog +* Sun Oct 15 2017 Christoph Berg - 1.6-0 +- New upstream version. * Tue Sep 27 2016 Christoph Berg - 1.5-0 - New upstream version. * Tue Feb 02 2016 Christoph Berg - 1.4-0 diff -Nru pgextwlist-1.5/README.md pgextwlist-1.6/README.md --- pgextwlist-1.5/README.md 2016-09-27 16:47:05.000000000 +0000 +++ pgextwlist-1.6/README.md 2017-10-15 12:39:40.000000000 +0000 @@ -16,6 +16,8 @@ owned by your *bootstrap superuser* and with `SECURITY DEFINER`, meaning that the extension and all its objects are owned by this *superuser*. +[![Build Status](https://travis-ci.org/dimitri/pgextwlist.svg?branch=master)](https://travis-ci.org/dimitri/pgextwlist) + ## Licence The `pgextwlist` PostgreSQL extension is released under @@ -52,7 +54,7 @@ * `custom_variable_classes` Add `extwlist` to the `custom_variable_classes` setting if you're using - 9.1, in 9.2 this setting disapeared. + 9.1, in 9.2 this setting disappeared. * `extwlist.extensions` diff -Nru pgextwlist-1.5/.travis.yml pgextwlist-1.6/.travis.yml --- pgextwlist-1.5/.travis.yml 1970-01-01 00:00:00.000000000 +0000 +++ pgextwlist-1.6/.travis.yml 2017-10-15 12:39:40.000000000 +0000 @@ -0,0 +1,50 @@ +# run the testsuite on travis-ci.com +--- +# versions to run on +env: + - PG_SUPPORTED_VERSIONS=9.2 + - PG_SUPPORTED_VERSIONS=9.3 + - PG_SUPPORTED_VERSIONS=9.4 + - PG_SUPPORTED_VERSIONS=9.5 + - PG_SUPPORTED_VERSIONS=9.6 + - PG_SUPPORTED_VERSIONS=10 + - PG_SUPPORTED_VERSIONS=11 + +language: C +dist: trusty +sudo: required + +before_install: + # apt.postgresql.org is already configured, we just need to add devel + - | + DIST=trusty-pgdg + case $PG_SUPPORTED_VERSIONS in + 11) + # update pgdg-source.list + sudo sed -i -e "s/pgdg.*/pgdg-testing main $PG_SUPPORTED_VERSIONS/" /etc/apt/sources.list.d/pgdg*.list + DIST=trusty-pgdg-testing + ;; + esac + - sudo apt-get -qq update + +install: + - export DEBIAN_FRONTEND=noninteractive # suppress warnings about deprecated PostgreSQL versions + # trusty's pg-srv-dev-all is too old, use -t $DIST to force installation of the pgdg version + - sudo apt-get install -t $DIST debhelper fakeroot postgresql-common postgresql-server-dev-all postgresql-server-dev-$PG_SUPPORTED_VERSIONS + # install PostgreSQL $PG_SUPPORTED_VERSIONS if not there yet + - | + if [ ! -x /usr/lib/postgresql/$PG_SUPPORTED_VERSIONS/bin/postgres ]; then + sudo /etc/init.d/postgresql stop # stop postgresql again before installing the server + sudo apt-get install postgresql-$PG_SUPPORTED_VERSIONS + fi + # stop the travis-provided cluster + - sudo /etc/init.d/postgresql stop + - pg_lsclusters + - dpkg -l postgresql\* | cat + +script: + - pg_buildext updatecontrol + - dpkg-buildpackage -us -uc -rfakeroot + - for deb in ../*.deb; do echo "$deb:"; dpkg-deb --info $deb; dpkg-deb --contents $deb; done + - sudo dpkg -i ../*.deb + - pg_buildext -i '--locale=C.UTF-8' -o local_preload_libraries=pgextwlist -o extwlist.extensions=citext,earthdistance,pg_trgm installcheck diff -Nru pgextwlist-1.5/utils.c pgextwlist-1.6/utils.c --- pgextwlist-1.5/utils.c 2016-09-27 16:47:05.000000000 +0000 +++ pgextwlist-1.6/utils.c 2017-10-15 12:39:40.000000000 +0000 @@ -394,19 +394,31 @@ */ foreach(lc1, raw_parsetree_list) { +#if PG_MAJOR_VERSION >= 1000 + RawStmt *parsetree = lfirst_node(RawStmt, lc1); +#else Node *parsetree = (Node *) lfirst(lc1); +#endif List *stmt_list; ListCell *lc2; stmt_list = pg_analyze_and_rewrite(parsetree, sql, NULL, - 0); + 0 +#if PG_MAJOR_VERSION >= 1000 + , NULL +#endif + ); stmt_list = pg_plan_queries(stmt_list, 0, NULL); foreach(lc2, stmt_list) { +#if PG_MAJOR_VERSION >= 1000 + PlannedStmt *stmt = lfirst_node(PlannedStmt, lc2); +#else Node *stmt = (Node *) lfirst(lc2); +#endif if (IsA(stmt, TransactionStmt)) ereport(ERROR, @@ -425,10 +437,18 @@ qdesc = CreateQueryDesc((PlannedStmt *) stmt, sql, GetActiveSnapshot(), NULL, - dest, NULL, 0); + dest, NULL, +#if PG_MAJOR_VERSION >= 1000 + NULL, +#endif + 0); ExecutorStart(qdesc, 0); - ExecutorRun(qdesc, ForwardScanDirection, 0); + ExecutorRun(qdesc, ForwardScanDirection, 0 +#if PG_MAJOR_VERSION >= 1000 + , true +#endif + ); ExecutorFinish(qdesc); ExecutorEnd(qdesc); @@ -436,21 +456,20 @@ } else { -#if PG_MAJOR_VERSION >= 903 ProcessUtility(stmt, sql, +#if PG_MAJOR_VERSION >= 903 PROCESS_UTILITY_QUERY, +#endif NULL, - dest, - NULL); -#elif PG_MAJOR_VERSION < 903 - ProcessUtility(stmt, - sql, +#if PG_MAJOR_VERSION >= 1000 NULL, +#endif +#if PG_MAJOR_VERSION < 903 false, /* not top level */ +#endif dest, NULL); -#endif } PopActiveSnapshot(); diff -Nru pgextwlist-1.5/utils.h pgextwlist-1.6/utils.h --- pgextwlist-1.5/utils.h 2016-09-27 16:47:05.000000000 +0000 +++ pgextwlist-1.6/utils.h 2017-10-15 12:39:40.000000000 +0000 @@ -12,6 +12,7 @@ #define __UTILS_H__ #include "utils/builtins.h" +#include "nodes/pg_list.h" #define MAXPGPATH 1024