mirror of
https://github.com/postgres/postgres.git
synced 2025-07-26 01:22:12 +03:00
Fix more things to be parallel-safe.
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
This commit is contained in:
@ -890,7 +890,7 @@ FROM pg_catalog.ts_parse(
|
|||||||
) AS tt
|
) AS tt
|
||||||
WHERE tt.tokid = parse.tokid
|
WHERE tt.tokid = parse.tokid
|
||||||
$$
|
$$
|
||||||
LANGUAGE SQL STRICT STABLE;
|
LANGUAGE SQL STRICT STABLE PARALLEL SAFE;
|
||||||
|
|
||||||
COMMENT ON FUNCTION ts_debug(regconfig,text) IS
|
COMMENT ON FUNCTION ts_debug(regconfig,text) IS
|
||||||
'debug function for text search configuration';
|
'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);
|
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
|
COMMENT ON FUNCTION ts_debug(text) IS
|
||||||
'debug function for current text search configuration';
|
'debug function for current text search configuration';
|
||||||
@ -928,12 +928,12 @@ CREATE OR REPLACE FUNCTION
|
|||||||
-- legacy definition for compatibility with 9.3
|
-- legacy definition for compatibility with 9.3
|
||||||
CREATE OR REPLACE FUNCTION
|
CREATE OR REPLACE FUNCTION
|
||||||
json_populate_record(base anyelement, from_json json, use_json_as_text boolean DEFAULT false)
|
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
|
-- legacy definition for compatibility with 9.3
|
||||||
CREATE OR REPLACE FUNCTION
|
CREATE OR REPLACE FUNCTION
|
||||||
json_populate_recordset(base anyelement, from_json json, use_json_as_text boolean DEFAULT false)
|
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(
|
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 '{}',
|
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)
|
secs double precision DEFAULT 0.0)
|
||||||
RETURNS interval
|
RETURNS interval
|
||||||
LANGUAGE INTERNAL
|
LANGUAGE INTERNAL
|
||||||
STRICT IMMUTABLE
|
STRICT IMMUTABLE PARALLEL SAFE
|
||||||
AS 'make_interval';
|
AS 'make_interval';
|
||||||
|
|
||||||
CREATE OR REPLACE FUNCTION
|
CREATE OR REPLACE FUNCTION
|
||||||
@ -989,14 +989,14 @@ CREATE OR REPLACE FUNCTION
|
|||||||
create_if_missing boolean DEFAULT true)
|
create_if_missing boolean DEFAULT true)
|
||||||
RETURNS jsonb
|
RETURNS jsonb
|
||||||
LANGUAGE INTERNAL
|
LANGUAGE INTERNAL
|
||||||
STRICT IMMUTABLE
|
STRICT IMMUTABLE PARALLEL SAFE
|
||||||
AS 'jsonb_set';
|
AS 'jsonb_set';
|
||||||
|
|
||||||
CREATE OR REPLACE FUNCTION
|
CREATE OR REPLACE FUNCTION
|
||||||
parse_ident(str text, strict boolean DEFAULT true)
|
parse_ident(str text, strict boolean DEFAULT true)
|
||||||
RETURNS text[]
|
RETURNS text[]
|
||||||
LANGUAGE INTERNAL
|
LANGUAGE INTERNAL
|
||||||
STRICT IMMUTABLE
|
STRICT IMMUTABLE PARALLEL SAFE
|
||||||
AS 'parse_ident';
|
AS 'parse_ident';
|
||||||
|
|
||||||
CREATE OR REPLACE FUNCTION
|
CREATE OR REPLACE FUNCTION
|
||||||
@ -1004,7 +1004,7 @@ CREATE OR REPLACE FUNCTION
|
|||||||
insert_after boolean DEFAULT false)
|
insert_after boolean DEFAULT false)
|
||||||
RETURNS jsonb
|
RETURNS jsonb
|
||||||
LANGUAGE INTERNAL
|
LANGUAGE INTERNAL
|
||||||
STRICT IMMUTABLE
|
STRICT IMMUTABLE PARALLEL SAFE
|
||||||
AS 'jsonb_insert';
|
AS 'jsonb_insert';
|
||||||
|
|
||||||
-- The default permissions for functions mean that anyone can execute them.
|
-- The default permissions for functions mean that anyone can execute them.
|
||||||
|
@ -173,7 +173,7 @@ $(SQLSCRIPT): Makefile
|
|||||||
func=$$1; shift; \
|
func=$$1; shift; \
|
||||||
obj=$$1; shift; \
|
obj=$$1; shift; \
|
||||||
echo "-- $$se --> $$de"; \
|
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 "COMMENT ON FUNCTION $$func(INTEGER, INTEGER, CSTRING, INTERNAL, INTEGER) IS 'internal conversion function for $$se to $$de';"; \
|
||||||
echo "DROP CONVERSION pg_catalog.$$name;"; \
|
echo "DROP CONVERSION pg_catalog.$$name;"; \
|
||||||
echo "CREATE DEFAULT CONVERSION pg_catalog.$$name FOR '$$se' TO '$$de' FROM $$func;"; \
|
echo "CREATE DEFAULT CONVERSION pg_catalog.$$name FOR '$$se' TO '$$de' FROM $$func;"; \
|
||||||
|
@ -53,6 +53,6 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/* yyyymmddN */
|
/* yyyymmddN */
|
||||||
#define CATALOG_VERSION_NO 201605021
|
#define CATALOG_VERSION_NO 201605031
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
Reference in New Issue
Block a user