Skip to content

Commit f2f7e50

Browse 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 ef325ee commit f2f7e50

File tree

35 files changed

+71
-57
lines changed

35 files changed

+71
-57
lines changed

contrib/amcheck/verify_heapam.c

Lines 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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1934,7 +1934,7 @@ dblink_get_notify(PG_FUNCTION_ARGS)
19341934
else
19351935
conn = pconn->conn;
19361936

1937-
SetSingleFuncCall(fcinfo, 0);
1937+
InitMaterializedSRF(fcinfo, 0);
19381938

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

contrib/pageinspect/brinfuncs.c

Lines 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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ gist_page_items_bytea(PG_FUNCTION_ARGS)
129129
(errcode(ERRCODE_INSUFFICIENT_PRIVILEGE),
130130
errmsg("must be superuser to use raw page functions")));
131131

132-
SetSingleFuncCall(fcinfo, 0);
132+
InitMaterializedSRF(fcinfo, 0);
133133

134134
page = get_page_from_raw(raw_page);
135135

@@ -213,7 +213,7 @@ gist_page_items(PG_FUNCTION_ARGS)
213213
(errcode(ERRCODE_INSUFFICIENT_PRIVILEGE),
214214
errmsg("must be superuser to use raw page functions")));
215215

216-
SetSingleFuncCall(fcinfo, 0);
216+
InitMaterializedSRF(fcinfo, 0);
217217

218218
/* Open the relation */
219219
indexRel = index_open(indexRelid, AccessShareLock);

contrib/pg_stat_statements/pg_stat_statements.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1555,7 +1555,7 @@ pg_stat_statements_internal(FunctionCallInfo fcinfo,
15551555
(errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
15561556
errmsg("pg_stat_statements must be loaded via shared_preload_libraries")));
15571557

1558-
SetSingleFuncCall(fcinfo, 0);
1558+
InitMaterializedSRF(fcinfo, 0);
15591559

15601560
/*
15611561
* Check we have the expected number of output arguments. Aside from

contrib/pg_walinspect/pg_walinspect.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,7 @@ GetWALRecordsInfo(FunctionCallInfo fcinfo, XLogRecPtr start_lsn,
333333
Datum values[PG_GET_WAL_RECORDS_INFO_COLS];
334334
bool nulls[PG_GET_WAL_RECORDS_INFO_COLS];
335335

336-
SetSingleFuncCall(fcinfo, 0);
336+
InitMaterializedSRF(fcinfo, 0);
337337

338338
xlogreader = InitXLogReaderState(start_lsn);
339339

@@ -554,7 +554,7 @@ GetWalStats(FunctionCallInfo fcinfo, XLogRecPtr start_lsn,
554554
Datum values[PG_GET_WAL_STATS_COLS];
555555
bool nulls[PG_GET_WAL_STATS_COLS];
556556

557-
SetSingleFuncCall(fcinfo, 0);
557+
InitMaterializedSRF(fcinfo, 0);
558558

559559
xlogreader = InitXLogReaderState(start_lsn);
560560

contrib/pgrowlocks/pgrowlocks.c

Lines 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

Lines 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

Lines 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

Lines 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
{

0 commit comments

Comments
 (0)