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

Commitcae4974

Browse files
Dynamic array required within pg_stat_replication.
1 parentdcfe3f6 commitcae4974

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
MemoryContextper_query_ctx;
13241324
MemoryContextoldcontext;
1325-
intsync_priority[max_wal_senders];
1325+
int*sync_priority;
13261326
intpriority=0;
13271327
intsync_standby=-1;
13281328
inti;
@@ -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)

[8]ページ先頭

©2009-2025 Movatter.jp