From a19e5cee635dc94c9c6e44c8863b4b770920a04b Mon Sep 17 00:00:00 2001 From: Michael Paquier Date: Tue, 18 Oct 2022 10:22:35 +0900 Subject: Rename SetSingleFuncCall() to InitMaterializedSRF() Per discussion, the existing routine name able to initialize a SRF function with materialize mode is unpopular, so rename it. Equally, the flags of this function are renamed, as of: - SRF_SINGLE_USE_EXPECTED -> MAT_SRF_USE_EXPECTED_DESC - SRF_SINGLE_BLESS -> MAT_SRF_BLESS The previous function and flags introduced in 9e98583 are kept around for compatibility purposes, so as any extension code already compiled with v15 continues to work as-is. The declarations introduced here for compatibility will be removed from HEAD in a follow-up commit. The new names have been suggested by Andres Freund and Melanie Plageman. Discussion: https://postgr.es/m/20221013194820.ciktb2sbbpw7cljm@awork3.anarazel.de Backpatch-through: 15 --- src/backend/utils/adt/jsonfuncs.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'src/backend/utils/adt/jsonfuncs.c') diff --git a/src/backend/utils/adt/jsonfuncs.c b/src/backend/utils/adt/jsonfuncs.c index fd0d355789c..bfc3f02a863 100644 --- a/src/backend/utils/adt/jsonfuncs.c +++ b/src/backend/utils/adt/jsonfuncs.c @@ -1921,7 +1921,7 @@ each_worker_jsonb(FunctionCallInfo fcinfo, const char *funcname, bool as_text) funcname))); rsi = (ReturnSetInfo *) fcinfo->resultinfo; - SetSingleFuncCall(fcinfo, SRF_SINGLE_BLESS); + InitMaterializedSRF(fcinfo, MAT_SRF_BLESS); tmp_cxt = AllocSetContextCreate(CurrentMemoryContext, "jsonb_each temporary cxt", @@ -2001,7 +2001,7 @@ each_worker(FunctionCallInfo fcinfo, bool as_text) rsi = (ReturnSetInfo *) fcinfo->resultinfo; - SetSingleFuncCall(fcinfo, SRF_SINGLE_BLESS); + InitMaterializedSRF(fcinfo, MAT_SRF_BLESS); state->tuple_store = rsi->setResult; state->ret_tdesc = rsi->setDesc; @@ -2164,8 +2164,7 @@ elements_worker_jsonb(FunctionCallInfo fcinfo, const char *funcname, rsi = (ReturnSetInfo *) fcinfo->resultinfo; - SetSingleFuncCall(fcinfo, - SRF_SINGLE_USE_EXPECTED | SRF_SINGLE_BLESS); + InitMaterializedSRF(fcinfo, MAT_SRF_USE_EXPECTED_DESC | MAT_SRF_BLESS); tmp_cxt = AllocSetContextCreate(CurrentMemoryContext, "jsonb_array_elements temporary cxt", @@ -2243,7 +2242,7 @@ elements_worker(FunctionCallInfo fcinfo, const char *funcname, bool as_text) state = palloc0(sizeof(ElementsState)); sem = palloc0(sizeof(JsonSemAction)); - SetSingleFuncCall(fcinfo, SRF_SINGLE_USE_EXPECTED | SRF_SINGLE_BLESS); + InitMaterializedSRF(fcinfo, MAT_SRF_USE_EXPECTED_DESC | MAT_SRF_BLESS); rsi = (ReturnSetInfo *) fcinfo->resultinfo; state->tuple_store = rsi->setResult; state->ret_tdesc = rsi->setDesc; -- cgit v1.2.3