From cca57c1d9bf7eeba5b81115e0b82651cf3d8e4ea Mon Sep 17 00:00:00 2001 From: Amit Kapila Date: Wed, 14 Apr 2021 08:55:03 +0530 Subject: Use NameData datatype for slotname in stats. This will make it consistent with the other usage of slotname in the code. In the passing, change pgstat_report_replslot signature to use a structure rather than multiple parameters. Reported-by: Andres Freund Author: Vignesh C Reviewed-by: Sawada Masahiko, Amit Kapila Discussion: https://postgr.es/m/20210319185247.ldebgpdaxsowiflw@alap3.anarazel.de --- src/backend/utils/adt/pgstatfuncs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/backend/utils/adt/pgstatfuncs.c') diff --git a/src/backend/utils/adt/pgstatfuncs.c b/src/backend/utils/adt/pgstatfuncs.c index 182b15e3f23..521ba736143 100644 --- a/src/backend/utils/adt/pgstatfuncs.c +++ b/src/backend/utils/adt/pgstatfuncs.c @@ -2328,7 +2328,7 @@ pg_stat_get_replication_slots(PG_FUNCTION_ARGS) MemSet(values, 0, sizeof(values)); MemSet(nulls, 0, sizeof(nulls)); - values[0] = PointerGetDatum(cstring_to_text(s->slotname)); + values[0] = CStringGetTextDatum(NameStr(s->slotname)); values[1] = Int64GetDatum(s->spill_txns); values[2] = Int64GetDatum(s->spill_count); values[3] = Int64GetDatum(s->spill_bytes); -- cgit v1.2.3