Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit9888b34

Browse files
committed
Fix more things to be parallel-safe.
Conversion functions were previously marked as parallel-unsafe, sincethat is the default, but in fact they are safe. Parallel-safefunctions defined in pg_proc.h and redefined in system_views.sql wereending up as parallel-unsafe because the redeclarations were notmarked PARALLEL SAFE. While editing system_views.sql, mark ts_debug()parallel safe also.Andreas Karlsson
1 parent8826d85 commit9888b34

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

‎src/backend/catalog/system_views.sql

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -890,7 +890,7 @@ FROM pg_catalog.ts_parse(
890890
)AS tt
891891
WHEREtt.tokid=parse.tokid
892892
$$
893-
LANGUAGE SQL STRICT STABLE;
893+
LANGUAGE SQL STRICT STABLE PARALLEL SAFE;
894894

895895
COMMENT ON FUNCTION ts_debug(regconfig,text) IS
896896
'debug function for text search configuration';
@@ -906,7 +906,7 @@ RETURNS SETOF record AS
906906
$$
907907
SELECT*FROMpg_catalog.ts_debug(pg_catalog.get_current_ts_config(), $1);
908908
$$
909-
LANGUAGE SQL STRICT STABLE;
909+
LANGUAGE SQL STRICT STABLE PARALLEL SAFE;
910910

911911
COMMENT ON FUNCTION ts_debug(text) IS
912912
'debug function for current text search configuration';
@@ -928,12 +928,12 @@ CREATE OR REPLACE FUNCTION
928928
-- legacy definition for compatibility with 9.3
929929
CREATEOR REPLACE FUNCTION
930930
json_populate_record(base anyelement, from_json json, use_json_as_textboolean DEFAULT false)
931-
RETURNS anyelement LANGUAGE internal STABLEAS'json_populate_record';
931+
RETURNS anyelement LANGUAGE internal STABLEAS'json_populate_record' PARALLEL SAFE;
932932

933933
-- legacy definition for compatibility with 9.3
934934
CREATEOR REPLACE FUNCTION
935935
json_populate_recordset(base anyelement, from_json json, use_json_as_textboolean DEFAULT false)
936-
RETURNS SETOF anyelement LANGUAGE internal STABLE ROWS100AS'json_populate_recordset';
936+
RETURNS SETOF anyelement LANGUAGE internal STABLE ROWS100AS'json_populate_recordset' PARALLEL SAFE;
937937

938938
CREATE OR REPLACEFUNCTIONpg_logical_slot_get_changes(
939939
IN slot_name name,IN upto_lsn pg_lsn,IN upto_nchangesint, VARIADIC optionstext[] DEFAULT'{}',
@@ -981,30 +981,30 @@ CREATE OR REPLACE FUNCTION
981981
secsdouble precision DEFAULT0.0)
982982
RETURNS interval
983983
LANGUAGE INTERNAL
984-
STRICT IMMUTABLE
984+
STRICT IMMUTABLE PARALLEL SAFE
985985
AS'make_interval';
986986

987987
CREATEOR REPLACE FUNCTION
988988
jsonb_set(jsonb_in jsonb,pathtext[] , replacement jsonb,
989989
create_if_missingboolean DEFAULT true)
990990
RETURNS jsonb
991991
LANGUAGE INTERNAL
992-
STRICT IMMUTABLE
992+
STRICT IMMUTABLE PARALLEL SAFE
993993
AS'jsonb_set';
994994

995995
CREATEOR REPLACE FUNCTION
996996
parse_ident(strtext, strictboolean DEFAULT true)
997997
RETURNStext[]
998998
LANGUAGE INTERNAL
999-
STRICT IMMUTABLE
999+
STRICT IMMUTABLE PARALLEL SAFE
10001000
AS'parse_ident';
10011001

10021002
CREATEOR REPLACE FUNCTION
10031003
jsonb_insert(jsonb_in jsonb,pathtext[] , replacement jsonb,
10041004
insert_afterboolean DEFAULT false)
10051005
RETURNS jsonb
10061006
LANGUAGE INTERNAL
1007-
STRICT IMMUTABLE
1007+
STRICT IMMUTABLE PARALLEL SAFE
10081008
AS'jsonb_insert';
10091009

10101010
-- The default permissions for functions mean that anyone can execute them.

‎src/backend/utils/mb/conversion_procs/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ $(SQLSCRIPT): Makefile
173173
func=$$1;shift;\
174174
obj=$$1;shift;\
175175
echo"--$$se -->$$de";\
176-
echo"CREATE OR REPLACE FUNCTION$$func (INTEGER, INTEGER, CSTRING, INTERNAL, INTEGER) RETURNS VOID AS '$$"libdir"/$$obj', '$$func' LANGUAGE C STRICT;";\
176+
echo"CREATE OR REPLACE FUNCTION$$func (INTEGER, INTEGER, CSTRING, INTERNAL, INTEGER) RETURNS VOID AS '$$"libdir"/$$obj', '$$func' LANGUAGE C STRICT PARALLEL SAFE;";\
177177
echo"COMMENT ON FUNCTION$$func(INTEGER, INTEGER, CSTRING, INTERNAL, INTEGER) IS 'internal conversion function for$$se to$$de';";\
178178
echo"DROP CONVERSION pg_catalog.$$name;";\
179179
echo"CREATE DEFAULT CONVERSION pg_catalog.$$name FOR '$$se' TO '$$de' FROM$$func;";\

‎src/include/catalog/catversion.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,6 @@
5353
*/
5454

5555
/*yyyymmddN */
56-
#defineCATALOG_VERSION_NO201605021
56+
#defineCATALOG_VERSION_NO201605031
5757

5858
#endif

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp