From 6b7d11ffda0b51b70978edcb1659cc62aa477f01 Mon Sep 17 00:00:00 2001 From: Robert Haas Date: Tue, 14 Jun 2016 14:52:55 -0400 Subject: [PATCH] Update sslinfo extension for parallel query. All functions provided by this extension are PARALLEL RESTRICTED, because they provide information about the connection state. Parallel workers don't have this information and therefore these functions can't be executed in a worker (but they can be present in a query some other part of which uses parallelism). Andreas Karlsson --- contrib/sslinfo/Makefile | 2 +- contrib/sslinfo/sslinfo--1.1--1.2.sql | 15 +++++++++++++ .../{sslinfo--1.1.sql => sslinfo--1.2.sql} | 22 +++++++++---------- contrib/sslinfo/sslinfo.control | 2 +- 4 files changed, 28 insertions(+), 13 deletions(-) create mode 100644 contrib/sslinfo/sslinfo--1.1--1.2.sql rename contrib/sslinfo/{sslinfo--1.1.sql => sslinfo--1.2.sql} (72%) diff --git a/contrib/sslinfo/Makefile b/contrib/sslinfo/Makefile index f6c147293c..5a972db703 100644 --- a/contrib/sslinfo/Makefile +++ b/contrib/sslinfo/Makefile @@ -4,7 +4,7 @@ MODULE_big = sslinfo OBJS = sslinfo.o $(WIN32RES) EXTENSION = sslinfo -DATA = sslinfo--1.0--1.1.sql sslinfo--1.1.sql \ +DATA = sslinfo--1.2.sql sslinfo--1.1--1.2.sql sslinfo--1.0--1.1.sql \ sslinfo--unpackaged--1.0.sql PGFILEDESC = "sslinfo - information about client SSL certificate" diff --git a/contrib/sslinfo/sslinfo--1.1--1.2.sql b/contrib/sslinfo/sslinfo--1.1--1.2.sql new file mode 100644 index 0000000000..f4f901438d --- /dev/null +++ b/contrib/sslinfo/sslinfo--1.1--1.2.sql @@ -0,0 +1,15 @@ +/* contrib/sslinfo/sslinfo--1.1--1.2.sql */ + +-- complain if script is sourced in psql, rather than via ALTER EXTENSION +\echo Use "ALTER EXTENSION sslinfo UPDATE TO '1.2'" to load this file. \quit + +ALTER FUNCTION ssl_client_serial() PARALLEL RESTRICTED; +ALTER FUNCTION ssl_is_used() PARALLEL RESTRICTED; +ALTER FUNCTION ssl_version() PARALLEL RESTRICTED; +ALTER FUNCTION ssl_cipher() PARALLEL RESTRICTED; +ALTER FUNCTION ssl_client_cert_present() PARALLEL RESTRICTED; +ALTER FUNCTION ssl_client_dn_field(text) PARALLEL RESTRICTED; +ALTER FUNCTION ssl_issuer_field(text) PARALLEL RESTRICTED; +ALTER FUNCTION ssl_client_dn() PARALLEL RESTRICTED; +ALTER FUNCTION ssl_issuer_dn() PARALLEL RESTRICTED; +ALTER FUNCTION ssl_extension_info() PARALLEL RESTRICTED; diff --git a/contrib/sslinfo/sslinfo--1.1.sql b/contrib/sslinfo/sslinfo--1.2.sql similarity index 72% rename from contrib/sslinfo/sslinfo--1.1.sql rename to contrib/sslinfo/sslinfo--1.2.sql index 92855e3144..a555cfb507 100644 --- a/contrib/sslinfo/sslinfo--1.1.sql +++ b/contrib/sslinfo/sslinfo--1.2.sql @@ -1,43 +1,43 @@ -/* contrib/sslinfo/sslinfo--1.1.sql */ +/* contrib/sslinfo/sslinfo--1.2.sql */ -- complain if script is sourced in psql, rather than via CREATE EXTENSION \echo Use "CREATE EXTENSION sslinfo" to load this file. \quit CREATE FUNCTION ssl_client_serial() RETURNS numeric AS 'MODULE_PATHNAME', 'ssl_client_serial' -LANGUAGE C STRICT; +LANGUAGE C STRICT PARALLEL RESTRICTED; CREATE FUNCTION ssl_is_used() RETURNS boolean AS 'MODULE_PATHNAME', 'ssl_is_used' -LANGUAGE C STRICT; +LANGUAGE C STRICT PARALLEL RESTRICTED; CREATE FUNCTION ssl_version() RETURNS text AS 'MODULE_PATHNAME', 'ssl_version' -LANGUAGE C STRICT; +LANGUAGE C STRICT PARALLEL RESTRICTED; CREATE FUNCTION ssl_cipher() RETURNS text AS 'MODULE_PATHNAME', 'ssl_cipher' -LANGUAGE C STRICT; +LANGUAGE C STRICT PARALLEL RESTRICTED; CREATE FUNCTION ssl_client_cert_present() RETURNS boolean AS 'MODULE_PATHNAME', 'ssl_client_cert_present' -LANGUAGE C STRICT; +LANGUAGE C STRICT PARALLEL RESTRICTED; CREATE FUNCTION ssl_client_dn_field(text) RETURNS text AS 'MODULE_PATHNAME', 'ssl_client_dn_field' -LANGUAGE C STRICT; +LANGUAGE C STRICT PARALLEL RESTRICTED; CREATE FUNCTION ssl_issuer_field(text) RETURNS text AS 'MODULE_PATHNAME', 'ssl_issuer_field' -LANGUAGE C STRICT; +LANGUAGE C STRICT PARALLEL RESTRICTED; CREATE FUNCTION ssl_client_dn() RETURNS text AS 'MODULE_PATHNAME', 'ssl_client_dn' -LANGUAGE C STRICT; +LANGUAGE C STRICT PARALLEL RESTRICTED; CREATE FUNCTION ssl_issuer_dn() RETURNS text AS 'MODULE_PATHNAME', 'ssl_issuer_dn' -LANGUAGE C STRICT; +LANGUAGE C STRICT PARALLEL RESTRICTED; CREATE FUNCTION ssl_extension_info(OUT name text, @@ -45,4 +45,4 @@ ssl_extension_info(OUT name text, OUT critical boolean ) RETURNS SETOF record AS 'MODULE_PATHNAME', 'ssl_extension_info' -LANGUAGE C STRICT; +LANGUAGE C STRICT PARALLEL RESTRICTED; diff --git a/contrib/sslinfo/sslinfo.control b/contrib/sslinfo/sslinfo.control index dfcf17efcf..c7754f924c 100644 --- a/contrib/sslinfo/sslinfo.control +++ b/contrib/sslinfo/sslinfo.control @@ -1,5 +1,5 @@ # sslinfo extension comment = 'information about SSL certificates' -default_version = '1.1' +default_version = '1.2' module_pathname = '$libdir/sslinfo' relocatable = true -- 2.40.0