Skip to content

Navigation Menu

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

Appearance settings

Commit a19e5ce

Browse filesBrowse files
committed
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
1 parent 77dd153 commit a19e5ce
Copy full SHA for a19e5ce

File tree

36 files changed

+72
-58
lines changed
Filter options

36 files changed

+72
-58
lines changed

‎contrib/amcheck/verify_heapam.c

Copy file name to clipboardExpand all lines: contrib/amcheck/verify_heapam.c
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ verify_heapam(PG_FUNCTION_ARGS)
278278
ctx.attnum = -1;
279279

280280
/* Construct the tuplestore and tuple descriptor */
281-
SetSingleFuncCall(fcinfo, 0);
281+
InitMaterializedSRF(fcinfo, 0);
282282
ctx.tupdesc = rsinfo->setDesc;
283283
ctx.tupstore = rsinfo->setResult;
284284

‎contrib/dblink/dblink.c

Copy file name to clipboardExpand all lines: contrib/dblink/dblink.c
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1933,7 +1933,7 @@ dblink_get_notify(PG_FUNCTION_ARGS)
19331933
else
19341934
conn = pconn->conn;
19351935

1936-
SetSingleFuncCall(fcinfo, 0);
1936+
InitMaterializedSRF(fcinfo, 0);
19371937

19381938
PQconsumeInput(conn);
19391939
while ((notify = PQnotifies(conn)) != NULL)

‎contrib/pageinspect/brinfuncs.c

Copy file name to clipboardExpand all lines: contrib/pageinspect/brinfuncs.c
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ brin_page_items(PG_FUNCTION_ARGS)
147147
(errcode(ERRCODE_INSUFFICIENT_PRIVILEGE),
148148
errmsg("must be superuser to use raw page functions")));
149149

150-
SetSingleFuncCall(fcinfo, 0);
150+
InitMaterializedSRF(fcinfo, 0);
151151

152152
indexRel = index_open(indexRelid, AccessShareLock);
153153

‎contrib/pageinspect/gistfuncs.c

Copy file name to clipboardExpand all lines: contrib/pageinspect/gistfuncs.c
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ gist_page_items_bytea(PG_FUNCTION_ARGS)
127127
(errcode(ERRCODE_INSUFFICIENT_PRIVILEGE),
128128
errmsg("must be superuser to use raw page functions")));
129129

130-
SetSingleFuncCall(fcinfo, 0);
130+
InitMaterializedSRF(fcinfo, 0);
131131

132132
page = get_page_from_raw(raw_page);
133133

@@ -211,7 +211,7 @@ gist_page_items(PG_FUNCTION_ARGS)
211211
(errcode(ERRCODE_INSUFFICIENT_PRIVILEGE),
212212
errmsg("must be superuser to use raw page functions")));
213213

214-
SetSingleFuncCall(fcinfo, 0);
214+
InitMaterializedSRF(fcinfo, 0);
215215

216216
/* Open the relation */
217217
indexRel = index_open(indexRelid, AccessShareLock);

‎contrib/pg_stat_statements/pg_stat_statements.c

Copy file name to clipboardExpand all lines: contrib/pg_stat_statements/pg_stat_statements.c
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1552,7 +1552,7 @@ pg_stat_statements_internal(FunctionCallInfo fcinfo,
15521552
(errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
15531553
errmsg("pg_stat_statements must be loaded via shared_preload_libraries")));
15541554

1555-
SetSingleFuncCall(fcinfo, 0);
1555+
InitMaterializedSRF(fcinfo, 0);
15561556

15571557
/*
15581558
* Check we have the expected number of output arguments. Aside from

‎contrib/pg_walinspect/pg_walinspect.c

Copy file name to clipboardExpand all lines: contrib/pg_walinspect/pg_walinspect.c
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,7 @@ GetWALRecordsInfo(FunctionCallInfo fcinfo, XLogRecPtr start_lsn,
330330
Datum values[PG_GET_WAL_RECORDS_INFO_COLS] = {0};
331331
bool nulls[PG_GET_WAL_RECORDS_INFO_COLS] = {0};
332332

333-
SetSingleFuncCall(fcinfo, 0);
333+
InitMaterializedSRF(fcinfo, 0);
334334

335335
xlogreader = InitXLogReaderState(start_lsn);
336336

@@ -548,7 +548,7 @@ GetWalStats(FunctionCallInfo fcinfo, XLogRecPtr start_lsn,
548548
Datum values[PG_GET_WAL_STATS_COLS] = {0};
549549
bool nulls[PG_GET_WAL_STATS_COLS] = {0};
550550

551-
SetSingleFuncCall(fcinfo, 0);
551+
InitMaterializedSRF(fcinfo, 0);
552552

553553
xlogreader = InitXLogReaderState(start_lsn);
554554

‎contrib/pgrowlocks/pgrowlocks.c

Copy file name to clipboardExpand all lines: contrib/pgrowlocks/pgrowlocks.c
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ pgrowlocks(PG_FUNCTION_ARGS)
7575
AclResult aclresult;
7676
char **values;
7777

78-
SetSingleFuncCall(fcinfo, 0);
78+
InitMaterializedSRF(fcinfo, 0);
7979

8080
/* Access the table */
8181
relrv = makeRangeVarFromNameList(textToQualifiedNameList(relname));

‎contrib/postgres_fdw/connection.c

Copy file name to clipboardExpand all lines: contrib/postgres_fdw/connection.c
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1668,7 +1668,7 @@ postgres_fdw_get_connections(PG_FUNCTION_ARGS)
16681668
HASH_SEQ_STATUS scan;
16691669
ConnCacheEntry *entry;
16701670

1671-
SetSingleFuncCall(fcinfo, 0);
1671+
InitMaterializedSRF(fcinfo, 0);
16721672

16731673
/* If cache doesn't exist, we return no records */
16741674
if (!ConnectionHash)

‎contrib/xml2/xpath.c

Copy file name to clipboardExpand all lines: contrib/xml2/xpath.c
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -511,7 +511,7 @@ xpath_table(PG_FUNCTION_ARGS)
511511
PgXmlErrorContext *xmlerrcxt;
512512
volatile xmlDocPtr doctree = NULL;
513513

514-
SetSingleFuncCall(fcinfo, SRF_SINGLE_USE_EXPECTED);
514+
InitMaterializedSRF(fcinfo, MAT_SRF_USE_EXPECTED_DESC);
515515

516516
/* must have at least one output column (for the pkey) */
517517
if (rsinfo->setDesc->natts < 1)

‎src/backend/access/transam/rmgr.c

Copy file name to clipboardExpand all lines: src/backend/access/transam/rmgr.c
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ pg_get_wal_resource_managers(PG_FUNCTION_ARGS)
145145
Datum values[PG_GET_RESOURCE_MANAGERS_COLS];
146146
bool nulls[PG_GET_RESOURCE_MANAGERS_COLS] = {0};
147147

148-
SetSingleFuncCall(fcinfo, 0);
148+
InitMaterializedSRF(fcinfo, 0);
149149

150150
for (int rmid = 0; rmid <= RM_MAX_ID; rmid++)
151151
{

‎src/backend/access/transam/xlogprefetcher.c

Copy file name to clipboardExpand all lines: src/backend/access/transam/xlogprefetcher.c
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -834,7 +834,7 @@ pg_stat_get_recovery_prefetch(PG_FUNCTION_ARGS)
834834
Datum values[PG_STAT_GET_RECOVERY_PREFETCH_COLS];
835835
bool nulls[PG_STAT_GET_RECOVERY_PREFETCH_COLS];
836836

837-
SetSingleFuncCall(fcinfo, 0);
837+
InitMaterializedSRF(fcinfo, 0);
838838

839839
for (int i = 0; i < PG_STAT_GET_RECOVERY_PREFETCH_COLS; ++i)
840840
nulls[i] = false;

‎src/backend/commands/event_trigger.c

Copy file name to clipboardExpand all lines: src/backend/commands/event_trigger.c
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1305,7 +1305,7 @@ pg_event_trigger_dropped_objects(PG_FUNCTION_ARGS)
13051305
"pg_event_trigger_dropped_objects()")));
13061306

13071307
/* Build tuplestore to hold the result rows */
1308-
SetSingleFuncCall(fcinfo, 0);
1308+
InitMaterializedSRF(fcinfo, 0);
13091309

13101310
slist_foreach(iter, &(currentEventTriggerState->SQLDropList))
13111311
{
@@ -1832,7 +1832,7 @@ pg_event_trigger_ddl_commands(PG_FUNCTION_ARGS)
18321832
"pg_event_trigger_ddl_commands()")));
18331833

18341834
/* Build tuplestore to hold the result rows */
1835-
SetSingleFuncCall(fcinfo, 0);
1835+
InitMaterializedSRF(fcinfo, 0);
18361836

18371837
foreach(lc, currentEventTriggerState->commandList)
18381838
{

‎src/backend/commands/extension.c

Copy file name to clipboardExpand all lines: src/backend/commands/extension.c
+3-3Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1946,7 +1946,7 @@ pg_available_extensions(PG_FUNCTION_ARGS)
19461946
struct dirent *de;
19471947

19481948
/* Build tuplestore to hold the result rows */
1949-
SetSingleFuncCall(fcinfo, 0);
1949+
InitMaterializedSRF(fcinfo, 0);
19501950

19511951
location = get_extension_control_directory();
19521952
dir = AllocateDir(location);
@@ -2026,7 +2026,7 @@ pg_available_extension_versions(PG_FUNCTION_ARGS)
20262026
struct dirent *de;
20272027

20282028
/* Build tuplestore to hold the result rows */
2029-
SetSingleFuncCall(fcinfo, 0);
2029+
InitMaterializedSRF(fcinfo, 0);
20302030

20312031
location = get_extension_control_directory();
20322032
dir = AllocateDir(location);
@@ -2281,7 +2281,7 @@ pg_extension_update_paths(PG_FUNCTION_ARGS)
22812281
check_valid_extension_name(NameStr(*extname));
22822282

22832283
/* Build tuplestore to hold the result rows */
2284-
SetSingleFuncCall(fcinfo, 0);
2284+
InitMaterializedSRF(fcinfo, 0);
22852285

22862286
/* Read the extension's control file */
22872287
control = read_extension_control_file(NameStr(*extname));

‎src/backend/commands/prepare.c

Copy file name to clipboardExpand all lines: src/backend/commands/prepare.c
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -672,7 +672,7 @@ pg_prepared_statement(PG_FUNCTION_ARGS)
672672
* We put all the tuples into a tuplestore in one scan of the hashtable.
673673
* This avoids any issue of the hashtable possibly changing between calls.
674674
*/
675-
SetSingleFuncCall(fcinfo, 0);
675+
InitMaterializedSRF(fcinfo, 0);
676676

677677
/* hash table might be uninitialized */
678678
if (prepared_queries)

‎src/backend/foreign/foreign.c

Copy file name to clipboardExpand all lines: src/backend/foreign/foreign.c
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -517,7 +517,7 @@ pg_options_to_table(PG_FUNCTION_ARGS)
517517
rsinfo = (ReturnSetInfo *) fcinfo->resultinfo;
518518

519519
/* prepare the result set */
520-
SetSingleFuncCall(fcinfo, SRF_SINGLE_USE_EXPECTED);
520+
InitMaterializedSRF(fcinfo, MAT_SRF_USE_EXPECTED_DESC);
521521

522522
foreach(cell, options)
523523
{

‎src/backend/replication/logical/launcher.c

Copy file name to clipboardExpand all lines: src/backend/replication/logical/launcher.c
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -930,7 +930,7 @@ pg_stat_get_subscription(PG_FUNCTION_ARGS)
930930
int i;
931931
ReturnSetInfo *rsinfo = (ReturnSetInfo *) fcinfo->resultinfo;
932932

933-
SetSingleFuncCall(fcinfo, 0);
933+
InitMaterializedSRF(fcinfo, 0);
934934

935935
/* Make sure we get consistent view of the workers. */
936936
LWLockAcquire(LogicalRepWorkerLock, LW_SHARED);

‎src/backend/replication/logical/logicalfuncs.c

Copy file name to clipboardExpand all lines: src/backend/replication/logical/logicalfuncs.c
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ pg_logical_slot_get_changes_guts(FunctionCallInfo fcinfo, bool confirm, bool bin
188188
}
189189
}
190190

191-
SetSingleFuncCall(fcinfo, 0);
191+
InitMaterializedSRF(fcinfo, 0);
192192
p->tupstore = rsinfo->setResult;
193193
p->tupdesc = rsinfo->setDesc;
194194

‎src/backend/replication/logical/origin.c

Copy file name to clipboardExpand all lines: src/backend/replication/logical/origin.c
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1503,7 +1503,7 @@ pg_show_replication_origin_status(PG_FUNCTION_ARGS)
15031503
/* we want to return 0 rows if slot is set to zero */
15041504
replorigin_check_prerequisites(false, true);
15051505

1506-
SetSingleFuncCall(fcinfo, 0);
1506+
InitMaterializedSRF(fcinfo, 0);
15071507

15081508
/* prevent slots from being concurrently dropped */
15091509
LWLockAcquire(ReplicationOriginLock, LW_SHARED);

‎src/backend/replication/slotfuncs.c

Copy file name to clipboardExpand all lines: src/backend/replication/slotfuncs.c
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ pg_get_replication_slots(PG_FUNCTION_ARGS)
242242
* name, which shouldn't contain anything particularly sensitive.
243243
*/
244244

245-
SetSingleFuncCall(fcinfo, 0);
245+
InitMaterializedSRF(fcinfo, 0);
246246

247247
currlsn = GetXLogWriteRecPtr();
248248

‎src/backend/replication/walsender.c

Copy file name to clipboardExpand all lines: src/backend/replication/walsender.c
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3459,7 +3459,7 @@ pg_stat_get_wal_senders(PG_FUNCTION_ARGS)
34593459
int num_standbys;
34603460
int i;
34613461

3462-
SetSingleFuncCall(fcinfo, 0);
3462+
InitMaterializedSRF(fcinfo, 0);
34633463

34643464
/*
34653465
* Get the currently active synchronous standbys. This could be out of

‎src/backend/storage/ipc/shmem.c

Copy file name to clipboardExpand all lines: src/backend/storage/ipc/shmem.c
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -543,7 +543,7 @@ pg_get_shmem_allocations(PG_FUNCTION_ARGS)
543543
Datum values[PG_GET_SHMEM_SIZES_COLS];
544544
bool nulls[PG_GET_SHMEM_SIZES_COLS];
545545

546-
SetSingleFuncCall(fcinfo, 0);
546+
InitMaterializedSRF(fcinfo, 0);
547547

548548
LWLockAcquire(ShmemIndexLock, LW_SHARED);
549549

‎src/backend/utils/adt/datetime.c

Copy file name to clipboardExpand all lines: src/backend/utils/adt/datetime.c
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5058,7 +5058,7 @@ pg_timezone_names(PG_FUNCTION_ARGS)
50585058
Interval *resInterval;
50595059
struct pg_itm_in itm_in;
50605060

5061-
SetSingleFuncCall(fcinfo, 0);
5061+
InitMaterializedSRF(fcinfo, 0);
50625062

50635063
/* initialize timezone scanning code */
50645064
tzenum = pg_tzenumerate_start();

‎src/backend/utils/adt/genfile.c

Copy file name to clipboardExpand all lines: src/backend/utils/adt/genfile.c
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -561,7 +561,7 @@ pg_ls_dir(PG_FUNCTION_ARGS)
561561
include_dot_dirs = PG_GETARG_BOOL(2);
562562
}
563563

564-
SetSingleFuncCall(fcinfo, SRF_SINGLE_USE_EXPECTED);
564+
InitMaterializedSRF(fcinfo, MAT_SRF_USE_EXPECTED_DESC);
565565

566566
dirdesc = AllocateDir(location);
567567
if (!dirdesc)
@@ -619,7 +619,7 @@ pg_ls_dir_files(FunctionCallInfo fcinfo, const char *dir, bool missing_ok)
619619
DIR *dirdesc;
620620
struct dirent *de;
621621

622-
SetSingleFuncCall(fcinfo, 0);
622+
InitMaterializedSRF(fcinfo, 0);
623623

624624
/*
625625
* Now walk the directory. Note that we must do this within a single SRF

‎src/backend/utils/adt/hbafuncs.c

Copy file name to clipboardExpand all lines: src/backend/utils/adt/hbafuncs.c
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -421,7 +421,7 @@ pg_hba_file_rules(PG_FUNCTION_ARGS)
421421
* also more efficient than having to look up our current position in the
422422
* parsed list every time.
423423
*/
424-
SetSingleFuncCall(fcinfo, 0);
424+
InitMaterializedSRF(fcinfo, 0);
425425

426426
/* Fill the tuplestore */
427427
rsi = (ReturnSetInfo *) fcinfo->resultinfo;
@@ -554,7 +554,7 @@ pg_ident_file_mappings(PG_FUNCTION_ARGS)
554554
* also more efficient than having to look up our current position in the
555555
* parsed list every time.
556556
*/
557-
SetSingleFuncCall(fcinfo, 0);
557+
InitMaterializedSRF(fcinfo, 0);
558558

559559
/* Fill the tuplestore */
560560
rsi = (ReturnSetInfo *) fcinfo->resultinfo;

‎src/backend/utils/adt/jsonfuncs.c

Copy file name to clipboardExpand all lines: src/backend/utils/adt/jsonfuncs.c
+4-5Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1921,7 +1921,7 @@ each_worker_jsonb(FunctionCallInfo fcinfo, const char *funcname, bool as_text)
19211921
funcname)));
19221922

19231923
rsi = (ReturnSetInfo *) fcinfo->resultinfo;
1924-
SetSingleFuncCall(fcinfo, SRF_SINGLE_BLESS);
1924+
InitMaterializedSRF(fcinfo, MAT_SRF_BLESS);
19251925

19261926
tmp_cxt = AllocSetContextCreate(CurrentMemoryContext,
19271927
"jsonb_each temporary cxt",
@@ -2001,7 +2001,7 @@ each_worker(FunctionCallInfo fcinfo, bool as_text)
20012001

20022002
rsi = (ReturnSetInfo *) fcinfo->resultinfo;
20032003

2004-
SetSingleFuncCall(fcinfo, SRF_SINGLE_BLESS);
2004+
InitMaterializedSRF(fcinfo, MAT_SRF_BLESS);
20052005
state->tuple_store = rsi->setResult;
20062006
state->ret_tdesc = rsi->setDesc;
20072007

@@ -2164,8 +2164,7 @@ elements_worker_jsonb(FunctionCallInfo fcinfo, const char *funcname,
21642164

21652165
rsi = (ReturnSetInfo *) fcinfo->resultinfo;
21662166

2167-
SetSingleFuncCall(fcinfo,
2168-
SRF_SINGLE_USE_EXPECTED | SRF_SINGLE_BLESS);
2167+
InitMaterializedSRF(fcinfo, MAT_SRF_USE_EXPECTED_DESC | MAT_SRF_BLESS);
21692168

21702169
tmp_cxt = AllocSetContextCreate(CurrentMemoryContext,
21712170
"jsonb_array_elements temporary cxt",
@@ -2243,7 +2242,7 @@ elements_worker(FunctionCallInfo fcinfo, const char *funcname, bool as_text)
22432242
state = palloc0(sizeof(ElementsState));
22442243
sem = palloc0(sizeof(JsonSemAction));
22452244

2246-
SetSingleFuncCall(fcinfo, SRF_SINGLE_USE_EXPECTED | SRF_SINGLE_BLESS);
2245+
InitMaterializedSRF(fcinfo, MAT_SRF_USE_EXPECTED_DESC | MAT_SRF_BLESS);
22472246
rsi = (ReturnSetInfo *) fcinfo->resultinfo;
22482247
state->tuple_store = rsi->setResult;
22492248
state->ret_tdesc = rsi->setDesc;

‎src/backend/utils/adt/mcxtfuncs.c

Copy file name to clipboardExpand all lines: src/backend/utils/adt/mcxtfuncs.c
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ pg_get_backend_memory_contexts(PG_FUNCTION_ARGS)
121121
{
122122
ReturnSetInfo *rsinfo = (ReturnSetInfo *) fcinfo->resultinfo;
123123

124-
SetSingleFuncCall(fcinfo, 0);
124+
InitMaterializedSRF(fcinfo, 0);
125125
PutMemoryContextsStatsTupleStore(rsinfo->setResult, rsinfo->setDesc,
126126
TopMemoryContext, NULL, 0);
127127

‎src/backend/utils/adt/misc.c

Copy file name to clipboardExpand all lines: src/backend/utils/adt/misc.c
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ pg_tablespace_databases(PG_FUNCTION_ARGS)
208208
DIR *dirdesc;
209209
struct dirent *de;
210210

211-
SetSingleFuncCall(fcinfo, SRF_SINGLE_USE_EXPECTED);
211+
InitMaterializedSRF(fcinfo, MAT_SRF_USE_EXPECTED_DESC);
212212

213213
if (tablespaceOid == GLOBALTABLESPACE_OID)
214214
{

‎src/backend/utils/adt/pgstatfuncs.c

Copy file name to clipboardExpand all lines: src/backend/utils/adt/pgstatfuncs.c
+3-3Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -502,7 +502,7 @@ pg_stat_get_progress_info(PG_FUNCTION_ARGS)
502502
(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
503503
errmsg("invalid command name: \"%s\"", cmd)));
504504

505-
SetSingleFuncCall(fcinfo, 0);
505+
InitMaterializedSRF(fcinfo, 0);
506506

507507
/* 1-based index */
508508
for (curr_backend = 1; curr_backend <= num_backends; curr_backend++)
@@ -559,7 +559,7 @@ pg_stat_get_activity(PG_FUNCTION_ARGS)
559559
int pid = PG_ARGISNULL(0) ? -1 : PG_GETARG_INT32(0);
560560
ReturnSetInfo *rsinfo = (ReturnSetInfo *) fcinfo->resultinfo;
561561

562-
SetSingleFuncCall(fcinfo, 0);
562+
InitMaterializedSRF(fcinfo, 0);
563563

564564
/* 1-based index */
565565
for (curr_backend = 1; curr_backend <= num_backends; curr_backend++)
@@ -1800,7 +1800,7 @@ pg_stat_get_slru(PG_FUNCTION_ARGS)
18001800
int i;
18011801
PgStat_SLRUStats *stats;
18021802

1803-
SetSingleFuncCall(fcinfo, 0);
1803+
InitMaterializedSRF(fcinfo, 0);
18041804

18051805
/* request SLRU stats from the cumulative stats system */
18061806
stats = pgstat_fetch_slru();

‎src/backend/utils/adt/varlena.c

Copy file name to clipboardExpand all lines: src/backend/utils/adt/varlena.c
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4810,7 +4810,7 @@ text_to_table(PG_FUNCTION_ARGS)
48104810
SplitTextOutputData tstate;
48114811

48124812
tstate.astate = NULL;
4813-
SetSingleFuncCall(fcinfo, SRF_SINGLE_USE_EXPECTED);
4813+
InitMaterializedSRF(fcinfo, MAT_SRF_USE_EXPECTED_DESC);
48144814
tstate.tupstore = rsi->setResult;
48154815
tstate.tupdesc = rsi->setDesc;
48164816

‎src/backend/utils/fmgr/README

Copy file name to clipboardExpand all lines: src/backend/utils/fmgr/README
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,7 @@ If available, the expected tuple descriptor is passed in ReturnSetInfo;
305305
in other contexts the expectedDesc field will be NULL. The function need
306306
not pay attention to expectedDesc, but it may be useful in special cases.
307307

308-
SetSingleFuncCall() is a helper function able to setup the function's
308+
InitMaterializedSRF() is a helper function able to setup the function's
309309
ReturnSetInfo for a single call, filling in the Tuplestore and the
310310
TupleDesc with the proper configuration for Materialize mode.
311311

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.