Skip to content

Commit cae4974

Browse files
Dynamic array required within pg_stat_replication.
1 parent dcfe3f6 commit cae4974

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/backend/replication/walsender.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1322,7 +1322,7 @@ pg_stat_get_wal_senders(PG_FUNCTION_ARGS)
13221322
Tuplestorestate *tupstore;
13231323
MemoryContext per_query_ctx;
13241324
MemoryContext oldcontext;
1325-
int sync_priority[max_wal_senders];
1325+
int *sync_priority;
13261326
int priority = 0;
13271327
int sync_standby = -1;
13281328
int i;
@@ -1357,6 +1357,7 @@ pg_stat_get_wal_senders(PG_FUNCTION_ARGS)
13571357
* lock acquisitions and to allow us to evaluate who is the current
13581358
* sync standby. This code must match the code in SyncRepReleaseWaiters().
13591359
*/
1360+
sync_priority = palloc(sizeof(int) * max_wal_senders);
13601361
LWLockAcquire(SyncRepLock, LW_SHARED);
13611362
for (i = 0; i < max_wal_senders; i++)
13621363
{
@@ -1456,6 +1457,7 @@ pg_stat_get_wal_senders(PG_FUNCTION_ARGS)
14561457

14571458
tuplestore_putvalues(tupstore, tupdesc, values, nulls);
14581459
}
1460+
pfree(sync_priority);
14591461

14601462
/* clean up and return the tuplestore */
14611463
tuplestore_donestoring(tupstore);

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy