From: Stuart Henderson Subject: databases/pg_statsinfo, databases/pg_stats_reporter To: ports Date: Tue, 28 May 2024 14:34:17 +0100 databases/pg_statsinfo includes a program and loadable module for postgresql that's used to collect server stats. It seems to be fairly specific to postgresql major versions but hasn't been updated since 13.0. I've tried updating to 16.x (diff below) but am not getting far in testing - after adding the suggested lines to postgresql.conf and running the pg_statsinfo binary with various options I get errors like ERROR: query failed: ERROR: schema "statsinfo" does not exist databases/pg_stats_reporter is a PHP program taking data from the above. The version in-tree is for PHP 7.4 only. Also it looks like it should probably be tied to the pg_statsinfo version; currently it's a much older 3.2.1. Is anyone currently using one or both of these ports? If not, I wonder if they should be removed. if yes, does the update work? Index: pg_stats_reporter/Makefile =================================================================== RCS file: /cvs/ports/databases/pg_stats_reporter/Makefile,v diff -u -p -r1.16 Makefile --- pg_stats_reporter/Makefile 22 May 2024 11:36:26 -0000 1.16 +++ pg_stats_reporter/Makefile 28 May 2024 13:32:18 -0000 @@ -1,25 +1,23 @@ COMMENT = graphical report tool for PostgreSQL -DISTNAME = pg_stats_reporter-3.2.1 -REVISION = 4 -CATEGORIES = databases www +GH_ACCOUNT = ossc-db +GH_PROJECT = pg_stats_reporter +GH_TAGNAME = 16.0 -HOMEPAGE = https://pgstatsinfo.sourceforge.net/ -PORTROACH = site:https://github.com/ossc-db/pg_stats_reporter/releases/ +DISTNAME = pg_stats_reporter-16.0 +CATEGORIES = databases www # GPLv2 PERMIT_PACKAGE = Yes -SITES = ${SITE_SOURCEFORGE:=pgstatsinfo/} NO_BUILD = Yes NO_TEST = Yes -PREFIX = ${VARBASE}/www +PREFIX = ${VARBASE}/www INSTDIR = ${PREFIX}/pg_stats_reporter_lib/ SUBST_VARS += INSTDIR MODULES = lang/php -MODPHP_VERSION = 7.4 RUN_DEPENDS = lang/php/${MODPHP_VERSION},-pgsql \ lang/php/${MODPHP_VERSION},-intl @@ -29,7 +27,6 @@ do-install: cp -pR ${WRKSRC}/html/ ${PREFIX}/htdocs/ mv ${PREFIX}/htdocs/pg_stats_reporter/{pg_stats_reporter,index}.php cp -pR ${WRKSRC}/pg_stats_reporter_lib ${PREFIX} - chown -R ${SHAREOWN}:${SHAREGRP} ${INSTDIR} ${PREFIX}/htdocs/pg_stats_reporter/ - chown www:www ${INSTDIR}/{cache,compiled} + find ${INSTDIR} -name .gitkeep -delete .include Index: pg_stats_reporter/distinfo =================================================================== RCS file: /cvs/ports/databases/pg_stats_reporter/distinfo,v diff -u -p -r1.2 distinfo --- pg_stats_reporter/distinfo 13 May 2016 22:30:25 -0000 1.2 +++ pg_stats_reporter/distinfo 28 May 2024 13:32:18 -0000 @@ -1,2 +1,2 @@ -SHA256 (pg_stats_reporter-3.2.1.tar.gz) = dCiSCwCe8dn1svh+bYtE2jiV7nEN2R8K4YRN9CkK1L8= -SIZE (pg_stats_reporter-3.2.1.tar.gz) = 1314155 +SHA256 (pg_stats_reporter-16.0.tar.gz) = 2J7HtBDNRgw6gFcOaNC71kMmhbh2SkxqeIKVtQolPjg= +SIZE (pg_stats_reporter-16.0.tar.gz) = 3779269 Index: pg_stats_reporter/patches/patch-bin_pg_stats_reporter =================================================================== RCS file: /cvs/ports/databases/pg_stats_reporter/patches/patch-bin_pg_stats_reporter,v diff -u -p -r1.2 patch-bin_pg_stats_reporter --- pg_stats_reporter/patches/patch-bin_pg_stats_reporter 11 Mar 2022 18:31:35 -0000 1.2 +++ pg_stats_reporter/patches/patch-bin_pg_stats_reporter 28 May 2024 13:32:18 -0000 @@ -1,12 +1,13 @@ ---- bin/pg_stats_reporter.orig Thu Feb 18 06:11:25 2016 -+++ bin/pg_stats_reporter Sat May 14 00:24:52 2016 +Index: bin/pg_stats_reporter +--- bin/pg_stats_reporter.orig ++++ bin/pg_stats_reporter @@ -1,4 +1,4 @@ -#! /usr/bin/php -qC +#!${MODPHP_BIN} -qC - #include -@@ -391,8 +392,7 @@ prompt_for_password(void) - #if PG_VERSION_NUM >= 100000 - char *password; - -- password = pgut_malloc(100); -- simple_prompt("Password: ", password, 100, false); -+ password = simple_prompt("Password: ", false); - return password; - #else - return simple_prompt("Password: ", 100, false); -@@ -807,7 +807,7 @@ elog(int elevel, const char *fmt, ...) - do - { - va_start(args, fmt); -- ok = appendStringInfoVA(&edata->msg, fmt, args); -+ ok = appendStringInfoVA_(&edata->msg, fmt, args); - va_end(args); - } while (!ok); - len = strlen(fmt); -@@ -972,7 +972,7 @@ errmsg(const char *fmt,...) - do - { - va_start(args, fmt); -- ok = appendStringInfoVA(&edata->msg, fmt, args); -+ ok = appendStringInfoVA_(&edata->msg, fmt, args); - va_end(args); - } while (!ok); - len = strlen(fmt); -@@ -993,7 +993,7 @@ errdetail(const char *fmt,...) - do - { - va_start(args, fmt); -- ok = appendStringInfoVA(&edata->detail, fmt, args); -+ ok = appendStringInfoVA_(&edata->detail, fmt, args); - va_end(args); - } while (!ok); - trimStringBuffer(&edata->detail); -@@ -1179,7 +1179,7 @@ exit_or_abort(int exitcode) - * unlike the server code, this function automatically extend the buffer. - */ - bool --appendStringInfoVA(StringInfo str, const char *fmt, va_list args) -+appendStringInfoVA_(StringInfo str, const char *fmt, va_list args) - { - size_t avail; - int nprinted; Index: pg_statsinfo/patches/patch-agent_bin_pgut_pgut_h =================================================================== RCS file: pg_statsinfo/patches/patch-agent_bin_pgut_pgut_h diff -N pg_statsinfo/patches/patch-agent_bin_pgut_pgut_h --- pg_statsinfo/patches/patch-agent_bin_pgut_pgut_h 11 Mar 2022 18:31:35 -0000 1.2 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,14 +0,0 @@ -Fix conflict when using PostgreSQL 14. - -Index: agent/bin/pgut/pgut.h ---- agent/bin/pgut/pgut.h.orig -+++ agent/bin/pgut/pgut.h -@@ -151,7 +151,7 @@ extern void CHECK_FOR_INTERRUPTS(void); - #define appendStringInfoChar appendPQExpBufferChar - #define appendBinaryStringInfo appendBinaryPQExpBuffer - --extern bool appendStringInfoVA(StringInfo str, const char *fmt, va_list args) -+extern bool appendStringInfoVA_(StringInfo str, const char *fmt, va_list args) - __attribute__((format(PG_PRINTF_ATTRIBUTE, 2, 0))); - extern int appendStringInfoFile(StringInfo str, FILE *fp); - extern int appendStringInfoFd(StringInfo str, int fd); Index: pg_statsinfo/patches/patch-agent_common_h =================================================================== RCS file: /cvs/ports/databases/pg_statsinfo/patches/patch-agent_common_h,v diff -u -p -r1.3 patch-agent_common_h --- pg_statsinfo/patches/patch-agent_common_h 11 Mar 2022 18:31:35 -0000 1.3 +++ pg_statsinfo/patches/patch-agent_common_h 28 May 2024 13:32:18 -0000 @@ -1,5 +1,6 @@ ---- agent/common.h.orig Fri Feb 12 10:49:13 2016 -+++ agent/common.h Sun Sep 11 10:41:18 2016 +Index: agent/common.h +--- agent/common.h.orig ++++ agent/common.h @@ -12,9 +12,18 @@ #include "catalog/pg_control.h" @@ -20,7 +21,7 @@ #define LINUX_VERSION_AT_LEAST(major, minor, patch) \ (LINUX_VERSION_CODE >= KERNEL_VERSION(major, minor, patch)) -@@ -22,9 +31,11 @@ +@@ -22,11 +31,13 @@ #define GLIBC_VERSION_AT_LEAST(major, minor) \ (__GLIBC__ > major || (__GLIBC__ == major && __GLIBC_MINOR__ >= minor)) @@ -28,7 +29,18 @@ #ifndef HAVE_SYNC_FILE_RANGE #if (LINUX_VERSION_AT_LEAST(2,6,17) && GLIBC_VERSION_AT_LEAST(2,6)) #define HAVE_SYNC_FILE_RANGE -+#endif #endif #endif ++#endif + + /* Error level */ + #define DEBUG DEBUG2 +@@ -52,7 +63,7 @@ + #define STATSINFO_EXIT_FAILED 0xff + + /* lock file path */ +-#define TEMP_DIR "/run/pg_statsinfo" ++#define TEMP_DIR "/var/run/pg_statsinfo" + /* CRC calculation */ + #include "port/pg_crc32c.h" Index: pg_statsinfo/patches/patch-agent_lib_last_xact_activity_c =================================================================== RCS file: pg_statsinfo/patches/patch-agent_lib_last_xact_activity_c diff -N pg_statsinfo/patches/patch-agent_lib_last_xact_activity_c --- pg_statsinfo/patches/patch-agent_lib_last_xact_activity_c 11 Mar 2022 18:31:35 -0000 1.7 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,54 +0,0 @@ -Work with PostgreSQL 14. - -Index: agent/lib/last_xact_activity.c ---- agent/lib/last_xact_activity.c.orig -+++ agent/lib/last_xact_activity.c -@@ -99,7 +99,7 @@ static Size buffer_size(int nbackends); - #if PG_VERSION_NUM >= 90000 - static void myProcessUtility0(Node *parsetree, const char *queryString); - #if PG_VERSION_NUM >= 130000 --static void myProcessUtility(PlannedStmt *pstmt, const char *queryString, -+static void myProcessUtility(PlannedStmt *pstmt, const char *queryString, bool readOnlyTree, - ProcessUtilityContext context, ParamListInfo params, - QueryEnvironment *queryEnv, - DestReceiver *dest, QueryCompletion *qc); -@@ -290,7 +290,7 @@ myExecutorStart(QueryDesc *queryDesc, int eflags) - if (!(entry->inxact && entry->pid != MyProc->pid)) - { - #if PG_VERSION_NUM >= 90200 -- entry->xid = ProcGlobal->allPgXact[MyProc->pgprocno].xid; -+ entry->xid = MyProc->xid; - #else - entry->xid = MyProc->xid; - #endif -@@ -422,7 +422,7 @@ myProcessUtility0(Node *parsetree, const char *querySt - */ - #if PG_VERSION_NUM >= 130000 - static void --myProcessUtility(PlannedStmt *pstmt, const char *queryString, -+myProcessUtility(PlannedStmt *pstmt, const char *queryString, bool readOnlyTree, - ProcessUtilityContext context, ParamListInfo params, - QueryEnvironment *queryEnv, - DestReceiver *dest, QueryCompletion *qc) -@@ -435,10 +435,10 @@ myProcessUtility(PlannedStmt *pstmt, const char *query - PG_TRY(); - { - if (prev_ProcessUtility_hook) -- prev_ProcessUtility_hook(pstmt, queryString, context, params, -+ prev_ProcessUtility_hook(pstmt, queryString, true, context, params, - queryEnv, dest, qc); - else -- standard_ProcessUtility(pstmt, queryString, context, params, -+ standard_ProcessUtility(pstmt, queryString, true, context, params, - queryEnv, dest, qc); - } - PG_CATCH(); -@@ -855,7 +855,7 @@ init_entry(int beid, Oid userid) - { - entry->pid = MyProc->pid; - #if PG_VERSION_NUM >= 90200 -- entry->xid = ProcGlobal->allPgXact[MyProc->pgprocno].xid; -+ entry->xid = MyProc->xid; - #else - entry->xid = MyProc->xid; - #endif Index: pg_statsinfo/patches/patch-agent_lib_libstatsinfo_c =================================================================== RCS file: /cvs/ports/databases/pg_statsinfo/patches/patch-agent_lib_libstatsinfo_c,v diff -u -p -r1.9 patch-agent_lib_libstatsinfo_c --- pg_statsinfo/patches/patch-agent_lib_libstatsinfo_c 11 Mar 2022 18:31:35 -0000 1.9 +++ pg_statsinfo/patches/patch-agent_lib_libstatsinfo_c 28 May 2024 13:32:18 -0000 @@ -1,13 +1,7 @@ -Work with PostgreSQL 14. - Index: agent/lib/libstatsinfo.c --- agent/lib/libstatsinfo.c.orig +++ agent/lib/libstatsinfo.c -@@ -7,10 +7,10 @@ - #include "libstatsinfo.h" - - #include -+#include +@@ -10,7 +10,6 @@ #include #include #include @@ -15,252 +9,14 @@ Index: agent/lib/libstatsinfo.c #include #include #include -@@ -35,8 +35,10 @@ - #include "storage/procarray.h" - #include "utils/builtins.h" - #include "utils/guc.h" -+#include "utils/snapmgr.h" - #include "utils/lsyscache.h" - #include "utils/ps_status.h" -+#include "utils/varlena.h" - - #if PG_VERSION_NUM >= 90100 - #include "catalog/pg_collation.h" -@@ -608,6 +610,7 @@ sample_activity(void) - int waiting = 0; - int running = 0; - int i; -+ volatile PGPROC *proc = MyProc; - - if (!long_xacts) - { -@@ -696,7 +699,7 @@ sample_activity(void) - /* XXX: needs lock? */ - #if PG_VERSION_NUM >= 90200 - if ((proc = BackendPidGetProc(be->st_procpid)) == NULL || -- (ProcGlobal->allPgXact[proc->pgprocno].vacuumFlags & PROC_IN_VACUUM)) -+ (ProcGlobal->statusFlags[proc->pgxactoff] & PROC_IN_VACUUM)) - continue; - #else - if ((proc = BackendPidGetProc(be->st_procpid)) == NULL || -@@ -1903,9 +1906,11 @@ statsinfo_restart(PG_FUNCTION_ARGS) +@@ -1998,8 +1997,10 @@ done: #define NUM_STAT_FIELDS_MIN 6 /* not support a kernel that does not have the required fields at "/proc/stat" */ -+#if defined(__linux__) ++#if defined(__Linux__) #if !LINUX_VERSION_AT_LEAST(2,5,41) #error kernel version 2.5.41 or later is required - #endif -+#endif - - /* - * statsinfo_cpustats - get cpu information -@@ -1944,6 +1949,7 @@ statsinfo_cpustats_noarg(PG_FUNCTION_ARGS) - PG_RETURN_DATUM(get_cpustats(fcinfo, 0, 0, 0, 0)); - } - -+#ifdef __OpenBSD__ - static Datum - get_cpustats(FunctionCallInfo fcinfo, - int64 prev_cpu_user, -@@ -1956,6 +1962,59 @@ get_cpustats(FunctionCallInfo fcinfo, - int64 cpu_system; - int64 cpu_idle; - int64 cpu_iowait; -+ HeapTuple tuple; -+ Datum values[NUM_CPUSTATS_COLS]; -+ bool nulls[NUM_CPUSTATS_COLS]; -+ long cp_time[CPUSTATES]; -+ char errbuf[_POSIX2_LINE_MAX]; -+ int mib[] = {CTL_KERN, KERN_CPTIME}; -+ size_t size = sizeof( cp_time ); -+ -+ must_be_superuser(); -+ -+ /* Build a tuple descriptor for our result type */ -+ if (get_call_result_type(fcinfo, NULL, &tupdesc) != TYPEFUNC_COMPOSITE) -+ elog(ERROR, "return type must be a row type"); -+ -+ Assert(tupdesc->natts == lengthof(values)); -+ -+ if (sysctl(mib, 2, &cp_time, &size, NULL, 0) < 0) -+ elog(ERROR,"failed to get kern.cptime"); -+ -+ memset(nulls, 0, sizeof(nulls)); -+ memset(values, 0, sizeof(values)); -+ -+ cpu_user = cp_time[CP_USER] + cp_time[CP_IDLE]; -+ cpu_system = cp_time[CP_SYS]; -+ cpu_idle = cp_time[CP_IDLE]; -+ cpu_iowait = cp_time[CP_INTR]; -+ -+ values[0] = CStringGetTextDatum((char *)"cpu"); -+ values[1] = Int64GetDatum(cpu_user); -+ values[2] = Int64GetDatum(cpu_system); -+ values[3] = Int64GetDatum(cpu_idle); -+ values[4] = Int64GetDatum(cpu_iowait); -+ values[5] = Int16GetDatum(cpu_user < prev_cpu_user ? 1 : 0); -+ values[6] = Int16GetDatum(cpu_system < prev_cpu_system ? 1 : 0); -+ values[7] = Int16GetDatum(cpu_idle < prev_cpu_idle ? 1 : 0); -+ values[8] = Int16GetDatum(cpu_iowait < prev_cpu_iowait ? 1 : 0); -+ -+ tuple = heap_form_tuple(tupdesc, values, nulls); -+ return HeapTupleGetDatum(tuple); -+} -+#else -+static Datum -+get_cpustats(FunctionCallInfo fcinfo, -+ int64 prev_cpu_user, -+ int64 prev_cpu_system, -+ int64 prev_cpu_idle, -+ int64 prev_cpu_iowait) -+{ -+ TupleDesc tupdesc; -+ int64 cpu_user; -+ int64 cpu_system; -+ int64 cpu_idle; -+ int64 cpu_iowait; - List *records = NIL; - List *fields = NIL; - HeapTuple tuple; -@@ -2028,6 +2087,7 @@ get_cpustats(FunctionCallInfo fcinfo, - - return HeapTupleGetDatum(tuple); - } -+#endif - - #define NUM_DEVICESTATS_COLS 17 - #define TYPE_DEVICE_TABLESPACES TEXTOID -@@ -2201,10 +2261,46 @@ statsinfo_devicestats(PG_FUNCTION_ARGS) - /* - * statsinfo_loadavg - get loadavg information - */ -+#if defined(__OpenBSD__) - Datum - statsinfo_loadavg(PG_FUNCTION_ARGS) - { - TupleDesc tupdesc; -+ HeapTuple tuple; -+ Datum values[NUM_LOADAVG_COLS]; -+ bool nulls[NUM_LOADAVG_COLS]; -+ char errbuf[_POSIX2_LINE_MAX]; -+ struct loadavg load; -+ int mib[] = {CTL_VM, VM_LOADAVG}; -+ size_t size = sizeof( load ); -+ -+ must_be_superuser(); -+ -+ /* Build a tuple descriptor for our result type */ -+ if (get_call_result_type(fcinfo, NULL, &tupdesc) != TYPEFUNC_COMPOSITE) -+ elog(ERROR, "return type must be a row type"); -+ -+ Assert(tupdesc->natts == lengthof(values)); -+ -+ if (sysctl(mib, 2, &load, &size, NULL, 0) < 0) -+ elog(ERROR,"failed to get vm.loadavg"); -+ -+ memset(nulls, 0, sizeof(nulls)); -+ memset(values, 0, sizeof(values)); -+ -+ values[0] = Float4GetDatum(load.ldavg[0]); -+ values[1] = Float4GetDatum(load.ldavg[1]); -+ values[2] = Float4GetDatum(load.ldavg[2]); -+ -+ tuple = heap_form_tuple(tupdesc, values, nulls); -+ -+ return HeapTupleGetDatum(tuple); -+} -+#else -+Datum -+statsinfo_loadavg(PG_FUNCTION_ARGS) -+{ -+ TupleDesc tupdesc; - int fd; - char buffer[256]; - int nbytes; -@@ -2263,6 +2359,7 @@ statsinfo_loadavg(PG_FUNCTION_ARGS) - - return HeapTupleGetDatum(tuple); - } -+#endif - - #define FILE_MEMINFO "/proc/meminfo" - #define NUM_MEMORY_COLS 5 -@@ -2282,6 +2379,7 @@ compare_meminfo_table(const void *a, const void *b) - /* - * statsinfo_memory - get memory information - */ -+#if defined(__OpenBSD__) - Datum - statsinfo_memory(PG_FUNCTION_ARGS) - { -@@ -2289,6 +2387,36 @@ statsinfo_memory(PG_FUNCTION_ARGS) - HeapTuple tuple; - Datum values[NUM_MEMORY_COLS]; - bool nulls[NUM_MEMORY_COLS]; -+ -+ must_be_superuser(); -+ -+ /* Build a tuple descriptor for our result type */ -+ if (get_call_result_type(fcinfo, NULL, &tupdesc) != TYPEFUNC_COMPOSITE) -+ elog(ERROR, "return type must be a row type"); -+ -+ Assert(tupdesc->natts == lengthof(values)); -+ -+ memset(nulls, 0, sizeof(nulls)); -+ memset(values, 0, sizeof(values)); -+ -+ values[0] = Int64GetDatum(0); -+ values[1] = Int64GetDatum(0); -+ values[2] = Int64GetDatum(0); -+ values[3] = Int64GetDatum(0); -+ values[4] = Int64GetDatum(0); -+ -+ tuple = heap_form_tuple(tupdesc, values, nulls); -+ -+ return HeapTupleGetDatum(tuple); -+} -+#else -+Datum -+statsinfo_memory(PG_FUNCTION_ARGS) -+{ -+ TupleDesc tupdesc; -+ HeapTuple tuple; -+ Datum values[NUM_MEMORY_COLS]; -+ bool nulls[NUM_MEMORY_COLS]; - int fd; - char buffer[2048]; - int nbytes; -@@ -2387,6 +2515,7 @@ nextline: - - return HeapTupleGetDatum(tuple); - } +#endif + #endif - #define FILE_PROFILE "/proc/systemtap/statsinfo_prof/profile" - #define NUM_PROFILE_COLS 3 -@@ -2395,9 +2524,16 @@ nextline: /* - * statsinfo_profile - get profile information - */ -+#if defined(__OpenBSD__) - Datum - statsinfo_profile(PG_FUNCTION_ARGS) - { -+ PG_RETURN_VOID(); -+} -+#else -+Datum -+statsinfo_profile(PG_FUNCTION_ARGS) -+{ - ReturnSetInfo *rsinfo = (ReturnSetInfo *) fcinfo->resultinfo; - TupleDesc tupdesc; - Tuplestorestate *tupstore; -@@ -2504,6 +2640,7 @@ statsinfo_profile(PG_FUNCTION_ARGS) - - PG_RETURN_VOID(); - } -+#endif - - static bool - checked_write(int fd, const void *buf, int size) Index: pg_statsinfo/patches/patch-reporter_pgut_pgut_c =================================================================== RCS file: pg_statsinfo/patches/patch-reporter_pgut_pgut_c diff -N pg_statsinfo/patches/patch-reporter_pgut_pgut_c --- pg_statsinfo/patches/patch-reporter_pgut_pgut_c 11 Mar 2022 18:31:35 -0000 1.4 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,59 +0,0 @@ -Work with PostgreSQL 14. - -Index: reporter/pgut/pgut.c ---- reporter/pgut/pgut.c.orig -+++ reporter/pgut/pgut.c -@@ -9,6 +9,7 @@ - - #include "postgres_fe.h" - #include "libpq/pqsignal.h" -+#include "postgresql/server/common/string.h" - - #include - #include -@@ -390,8 +391,7 @@ prompt_for_password(void) - #if PG_VERSION_NUM >= 100000 - char *password; - -- password = pgut_malloc(100); -- simple_prompt("Password: ", password, 100, false); -+ password = simple_prompt("Password: ", false); - return password; - #else - return simple_prompt("Password: ", 100, false); -@@ -806,7 +806,7 @@ elog(int elevel, const char *fmt, ...) - do - { - va_start(args, fmt); -- ok = appendStringInfoVA(&edata->msg, fmt, args); -+ ok = appendStringInfoVA_(&edata->msg, fmt, args); - va_end(args); - } while (!ok); - len = strlen(fmt); -@@ -971,7 +971,7 @@ errmsg(const char *fmt,...) - do - { - va_start(args, fmt); -- ok = appendStringInfoVA(&edata->msg, fmt, args); -+ ok = appendStringInfoVA_(&edata->msg, fmt, args); - va_end(args); - } while (!ok); - len = strlen(fmt); -@@ -992,7 +992,7 @@ errdetail(const char *fmt,...) - do - { - va_start(args, fmt); -- ok = appendStringInfoVA(&edata->detail, fmt, args); -+ ok = appendStringInfoVA_(&edata->detail, fmt, args); - va_end(args); - } while (!ok); - trimStringBuffer(&edata->detail); -@@ -1178,7 +1178,7 @@ exit_or_abort(int exitcode) - * unlike the server code, this function automatically extend the buffer. - */ - bool --appendStringInfoVA(StringInfo str, const char *fmt, va_list args) -+appendStringInfoVA_(StringInfo str, const char *fmt, va_list args) - { - size_t avail; - int nprinted; Index: pg_statsinfo/patches/patch-reporter_pgut_pgut_h =================================================================== RCS file: pg_statsinfo/patches/patch-reporter_pgut_pgut_h diff -N pg_statsinfo/patches/patch-reporter_pgut_pgut_h --- pg_statsinfo/patches/patch-reporter_pgut_pgut_h 11 Mar 2022 18:31:35 -0000 1.2 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,14 +0,0 @@ -Work with PostgreSQL 14. - -Index: reporter/pgut/pgut.h ---- reporter/pgut/pgut.h.orig -+++ reporter/pgut/pgut.h -@@ -150,7 +150,7 @@ extern void CHECK_FOR_INTERRUPTS(void); - #define appendStringInfoChar appendPQExpBufferChar - #define appendBinaryStringInfo appendBinaryPQExpBuffer - --extern bool appendStringInfoVA(StringInfo str, const char *fmt, va_list args) -+extern bool appendStringInfoVA_(StringInfo str, const char *fmt, va_list args) - __attribute__((format(PG_PRINTF_ATTRIBUTE, 2, 0))); - extern int appendStringInfoFile(StringInfo str, FILE *fp); - extern int appendStringInfoFd(StringInfo str, int fd);