aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSimon Riggs <simon@2ndQuadrant.com>2011-03-07 00:26:30 +0000
committerSimon Riggs <simon@2ndQuadrant.com>2011-03-07 00:26:30 +0000
commitcae4974e3d4c0cb1237568b55a2cee4482d42f40 (patch)
tree022d4754a67a2677a19487b426128054bdb7df61 /src
parentdcfe3f60c12880c52fd3cb9b5d51ff44c946dd6c (diff)
downloadpostgresql-cae4974e3d4c0cb1237568b55a2cee4482d42f40.tar.gz
postgresql-cae4974e3d4c0cb1237568b55a2cee4482d42f40.zip
Dynamic array required within pg_stat_replication.
Diffstat (limited to 'src')
-rw-r--r--src/backend/replication/walsender.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/backend/replication/walsender.c b/src/backend/replication/walsender.c
index 94547245fee..59521129a1e 100644
--- a/src/backend/replication/walsender.c
+++ b/src/backend/replication/walsender.c
@@ -1322,7 +1322,7 @@ pg_stat_get_wal_senders(PG_FUNCTION_ARGS)
Tuplestorestate *tupstore;
MemoryContext per_query_ctx;
MemoryContext oldcontext;
- int sync_priority[max_wal_senders];
+ int *sync_priority;
int priority = 0;
int sync_standby = -1;
int i;
@@ -1357,6 +1357,7 @@ pg_stat_get_wal_senders(PG_FUNCTION_ARGS)
* lock acquisitions and to allow us to evaluate who is the current
* sync standby. This code must match the code in SyncRepReleaseWaiters().
*/
+ sync_priority = palloc(sizeof(int) * max_wal_senders);
LWLockAcquire(SyncRepLock, LW_SHARED);
for (i = 0; i < max_wal_senders; i++)
{
@@ -1456,6 +1457,7 @@ pg_stat_get_wal_senders(PG_FUNCTION_ARGS)
tuplestore_putvalues(tupstore, tupdesc, values, nulls);
}
+ pfree(sync_priority);
/* clean up and return the tuplestore */
tuplestore_donestoring(tupstore);