ELSE (spill_txns > 0)
END
INTO updated
- FROM pg_stat_replication_slots WHERE name='regression_slot';
+ FROM pg_stat_replication_slots WHERE slot_name='regression_slot';
exit WHEN updated;
(1 row)
-SELECT name, spill_txns > 0 AS spill_txns, spill_count > 0 AS spill_count FROM pg_stat_replication_slots;
- name | spill_txns | spill_count
+SELECT slot_name, spill_txns > 0 AS spill_txns, spill_count > 0 AS spill_count FROM pg_stat_replication_slots;
+ slot_name | spill_txns | spill_count
-----------------+------------+-------------
regression_slot | t | t
(1 row)
(1 row)
-SELECT name, spill_txns, spill_count FROM pg_stat_replication_slots;
- name | spill_txns | spill_count
+SELECT slot_name, spill_txns, spill_count FROM pg_stat_replication_slots;
+ slot_name | spill_txns | spill_count
-----------------+------------+-------------
regression_slot | 0 | 0
(1 row)
(1 row)
-SELECT name, spill_txns > 0 AS spill_txns, spill_count > 0 AS spill_count FROM pg_stat_replication_slots;
- name | spill_txns | spill_count
+SELECT slot_name, spill_txns > 0 AS spill_txns, spill_count > 0 AS spill_count FROM pg_stat_replication_slots;
+ slot_name | spill_txns | spill_count
-----------------+------------+-------------
regression_slot | t | t
(1 row)
ELSE (spill_txns > 0)
END
INTO updated
- FROM pg_stat_replication_slots WHERE name='regression_slot';
+ FROM pg_stat_replication_slots WHERE slot_name='regression_slot';
exit WHEN updated;
-- exact stats count as that can vary if any background transaction (say by
-- autovacuum) happens in parallel to the main transaction.
SELECT wait_for_decode_stats(false);
-SELECT name, spill_txns > 0 AS spill_txns, spill_count > 0 AS spill_count FROM pg_stat_replication_slots;
+SELECT slot_name, spill_txns > 0 AS spill_txns, spill_count > 0 AS spill_count FROM pg_stat_replication_slots;
-- reset the slot stats, and wait for stats collector to reset
SELECT pg_stat_reset_replication_slot('regression_slot');
SELECT wait_for_decode_stats(true);
-SELECT name, spill_txns, spill_count FROM pg_stat_replication_slots;
+SELECT slot_name, spill_txns, spill_count FROM pg_stat_replication_slots;
-- decode and check stats again.
SELECT count(*) FROM pg_logical_slot_peek_changes('regression_slot', NULL, NULL, 'skip-empty-xacts', '1');
SELECT wait_for_decode_stats(false);
-SELECT name, spill_txns > 0 AS spill_txns, spill_count > 0 AS spill_count FROM pg_stat_replication_slots;
+SELECT slot_name, spill_txns > 0 AS spill_txns, spill_count > 0 AS spill_count FROM pg_stat_replication_slots;
DROP FUNCTION wait_for_decode_stats(bool);
DROP TABLE stats_test;
<tbody>
<row>
<entry role="catalog_table_entry"><para role="column_definition">
- <structfield>name</structfield> <type>text</type>
+ <structfield>slot_name</structfield> <type>text</type>
</para>
<para>
A unique, cluster-wide identifier for the replication slot
CREATE VIEW pg_stat_replication_slots AS
SELECT
- s.name,
+ s.slot_name,
s.spill_txns,
s.spill_count,
s.spill_bytes,
Datum
pg_stat_get_replication_slots(PG_FUNCTION_ARGS)
{
-#define PG_STAT_GET_REPLICATION_SLOT_CLOS 5
+#define PG_STAT_GET_REPLICATION_SLOT_COLS 5
ReturnSetInfo *rsinfo = (ReturnSetInfo *) fcinfo->resultinfo;
TupleDesc tupdesc;
Tuplestorestate *tupstore;
slotstats = pgstat_fetch_replslot(&nstats);
for (i = 0; i < nstats; i++)
{
- Datum values[PG_STAT_GET_REPLICATION_SLOT_CLOS];
- bool nulls[PG_STAT_GET_REPLICATION_SLOT_CLOS];
+ Datum values[PG_STAT_GET_REPLICATION_SLOT_COLS];
+ bool nulls[PG_STAT_GET_REPLICATION_SLOT_COLS];
PgStat_ReplSlotStats *s = &(slotstats[i]);
MemSet(values, 0, sizeof(values));
*/
/* yyyymmddN */
-#define CATALOG_VERSION_NO 202010081
+#define CATALOG_VERSION_NO 202010201
#endif
prorettype => 'record', proargtypes => '',
proallargtypes => '{text,int8,int8,int8,timestamptz}',
proargmodes => '{o,o,o,o,o}',
- proargnames => '{name,spill_txns,spill_count,spill_bytes,stats_reset}',
+ proargnames => '{slot_name,spill_txns,spill_count,spill_bytes,stats_reset}',
prosrc => 'pg_stat_get_replication_slots' },
{ oid => '6118', descr => 'statistics: information about subscription',
proname => 'pg_stat_get_subscription', proisstrict => 'f', provolatile => 's',
FROM ((pg_stat_get_activity(NULL::integer) s(datid, pid, usesysid, application_name, state, query, wait_event_type, wait_event, xact_start, query_start, backend_start, state_change, client_addr, client_hostname, client_port, backend_xid, backend_xmin, backend_type, ssl, sslversion, sslcipher, sslbits, sslcompression, ssl_client_dn, ssl_client_serial, ssl_issuer_dn, gss_auth, gss_princ, gss_enc, leader_pid)
JOIN pg_stat_get_wal_senders() w(pid, state, sent_lsn, write_lsn, flush_lsn, replay_lsn, write_lag, flush_lag, replay_lag, sync_priority, sync_state, reply_time) ON ((s.pid = w.pid)))
LEFT JOIN pg_authid u ON ((s.usesysid = u.oid)));
-pg_stat_replication_slots| SELECT s.name,
+pg_stat_replication_slots| SELECT s.slot_name,
s.spill_txns,
s.spill_count,
s.spill_bytes,
s.stats_reset
- FROM pg_stat_get_replication_slots() s(name, spill_txns, spill_count, spill_bytes, stats_reset);
+ FROM pg_stat_get_replication_slots() s(slot_name, spill_txns, spill_count, spill_bytes, stats_reset);
pg_stat_slru| SELECT s.name,
s.blks_zeroed,
s.blks_hit,