]> granicus.if.org Git - postgresql/commitdiff
Fix more things to be parallel-safe.
authorRobert Haas <rhaas@postgresql.org>
Tue, 3 May 2016 18:36:38 +0000 (14:36 -0400)
committerRobert Haas <rhaas@postgresql.org>
Tue, 3 May 2016 18:36:38 +0000 (14:36 -0400)
Conversion functions were previously marked as parallel-unsafe, since
that is the default, but in fact they are safe.  Parallel-safe
functions defined in pg_proc.h and redefined in system_views.sql were
ending up as parallel-unsafe because the redeclarations were not
marked PARALLEL SAFE.  While editing system_views.sql, mark ts_debug()
parallel safe also.

Andreas Karlsson

src/backend/catalog/system_views.sql
src/backend/utils/mb/conversion_procs/Makefile
src/include/catalog/catversion.h

index 2542648d7347d3619823da90f04dcd39c534c2b3..272c02f32b7bce3af524c40e1752e30fe3cfe514 100644 (file)
@@ -890,7 +890,7 @@ FROM pg_catalog.ts_parse(
     ) AS tt
 WHERE tt.tokid = parse.tokid
 $$
-LANGUAGE SQL STRICT STABLE;
+LANGUAGE SQL STRICT STABLE PARALLEL SAFE;
 
 COMMENT ON FUNCTION ts_debug(regconfig,text) IS
     'debug function for text search configuration';
@@ -906,7 +906,7 @@ RETURNS SETOF record AS
 $$
     SELECT * FROM pg_catalog.ts_debug( pg_catalog.get_current_ts_config(), $1);
 $$
-LANGUAGE SQL STRICT STABLE;
+LANGUAGE SQL STRICT STABLE PARALLEL SAFE;
 
 COMMENT ON FUNCTION ts_debug(text) IS
     'debug function for current text search configuration';
@@ -928,12 +928,12 @@ CREATE OR REPLACE FUNCTION
 -- legacy definition for compatibility with 9.3
 CREATE OR REPLACE FUNCTION
   json_populate_record(base anyelement, from_json json, use_json_as_text boolean DEFAULT false)
-  RETURNS anyelement LANGUAGE internal STABLE AS 'json_populate_record';
+  RETURNS anyelement LANGUAGE internal STABLE AS 'json_populate_record' PARALLEL SAFE;
 
 -- legacy definition for compatibility with 9.3
 CREATE OR REPLACE FUNCTION
   json_populate_recordset(base anyelement, from_json json, use_json_as_text boolean DEFAULT false)
-  RETURNS SETOF anyelement LANGUAGE internal STABLE ROWS 100  AS 'json_populate_recordset';
+  RETURNS SETOF anyelement LANGUAGE internal STABLE ROWS 100  AS 'json_populate_recordset' PARALLEL SAFE;
 
 CREATE OR REPLACE FUNCTION pg_logical_slot_get_changes(
     IN slot_name name, IN upto_lsn pg_lsn, IN upto_nchanges int, VARIADIC options text[] DEFAULT '{}',
@@ -981,7 +981,7 @@ CREATE OR REPLACE FUNCTION
                 secs double precision DEFAULT 0.0)
 RETURNS interval
 LANGUAGE INTERNAL
-STRICT IMMUTABLE
+STRICT IMMUTABLE PARALLEL SAFE
 AS 'make_interval';
 
 CREATE OR REPLACE FUNCTION
@@ -989,14 +989,14 @@ CREATE OR REPLACE FUNCTION
             create_if_missing boolean DEFAULT true)
 RETURNS jsonb
 LANGUAGE INTERNAL
-STRICT IMMUTABLE
+STRICT IMMUTABLE PARALLEL SAFE
 AS 'jsonb_set';
 
 CREATE OR REPLACE FUNCTION
   parse_ident(str text, strict boolean DEFAULT true)
 RETURNS text[]
 LANGUAGE INTERNAL
-STRICT IMMUTABLE
+STRICT IMMUTABLE PARALLEL SAFE
 AS 'parse_ident';
 
 CREATE OR REPLACE FUNCTION
@@ -1004,7 +1004,7 @@ CREATE OR REPLACE FUNCTION
             insert_after boolean DEFAULT false)
 RETURNS jsonb
 LANGUAGE INTERNAL
-STRICT IMMUTABLE
+STRICT IMMUTABLE PARALLEL SAFE
 AS 'jsonb_insert';
 
 -- The default permissions for functions mean that anyone can execute them.
index 8b9780335a9d5d11a8c1b9af6ea69d47d68b6d78..879467ea5e31d16c98aa45edcf7954c83842257c 100644 (file)
@@ -173,7 +173,7 @@ $(SQLSCRIPT): Makefile
                func=$$1; shift; \
                obj=$$1; shift; \
                echo "-- $$se --> $$de"; \
-               echo "CREATE OR REPLACE FUNCTION $$func (INTEGER, INTEGER, CSTRING, INTERNAL, INTEGER) RETURNS VOID AS '$$"libdir"/$$obj', '$$func' LANGUAGE C STRICT;"; \
+               echo "CREATE OR REPLACE FUNCTION $$func (INTEGER, INTEGER, CSTRING, INTERNAL, INTEGER) RETURNS VOID AS '$$"libdir"/$$obj', '$$func' LANGUAGE C STRICT PARALLEL SAFE;"; \
                echo "COMMENT ON FUNCTION $$func(INTEGER, INTEGER, CSTRING, INTERNAL, INTEGER) IS 'internal conversion function for $$se to $$de';"; \
                echo "DROP CONVERSION pg_catalog.$$name;"; \
                echo "CREATE DEFAULT CONVERSION pg_catalog.$$name FOR '$$se' TO '$$de' FROM $$func;"; \
index b65663084a9a2aa3a28647c9242c3b1a51697e99..a5eba196e9904f7748da286e38954bbe40cfd61d 100644 (file)
@@ -53,6 +53,6 @@
  */
 
 /*                                                     yyyymmddN */
-#define CATALOG_VERSION_NO     201605021
+#define CATALOG_VERSION_NO     201605031
 
 #endif