Re: Predefined role pg_maintenance for VACUUM, ANALYZE, CHECKPOINT. - Mailing list pgsql-hackers

From Daniel Gustafsson
Subject Re: Predefined role pg_maintenance for VACUUM, ANALYZE, CHECKPOINT.
Date
Msg-id EF7C3433-EA11-443A-B8F8-E09862343D82@yesql.se
Whole thread Raw
In response to Re: Predefined role pg_maintenance for VACUUM, ANALYZE, CHECKPOINT.  (Stephen Frost <sfrost@snowman.net>)
List pgsql-hackers
> On 2 Nov 2021, at 19:26, Stephen Frost <sfrost@snowman.net> wrote:

>> Otherwise, I see a couple of warnings when compiling:
>>        xlogfuncs.c:54: warning: implicit declaration of function ‘RequestCheckpoint’
>>        xlogfuncs.c:56: warning: control reaches end of non-void function
>
> Yeah, such things would need to be cleaned up, of course.

The Commitfest CI has -Werror,-Wimplicit-function-declaration on some platforms
in which this patch breaks, so I think we should apply the below (or something
similar) to ensure this is tested everywhere:

diff --git a/src/backend/access/transam/xlogfuncs.c b/src/backend/access/transam/xlogfuncs.c
index 7ecaca4788..c9e1df39c1 100644
--- a/src/backend/access/transam/xlogfuncs.c
+++ b/src/backend/access/transam/xlogfuncs.c
@@ -26,6 +26,7 @@
 #include "funcapi.h"
 #include "miscadmin.h"
 #include "pgstat.h"
+#include "postmaster/bgwriter.h"
 #include "replication/walreceiver.h"
 #include "storage/fd.h"
 #include "storage/ipc.h"
@@ -53,6 +54,7 @@ pg_checkpoint(PG_FUNCTION_ARGS)
 {
        RequestCheckpoint(CHECKPOINT_IMMEDIATE | CHECKPOINT_WAIT |
                                          (RecoveryInProgress() ? 0 : CHECKPOINT_FORCE));
+       PG_RETURN_VOID();
 }

--
Daniel Gustafsson        https://vmware.com/




pgsql-hackers by date:

Previous
From: James Coleman
Date:
Subject: Re: Consider parallel for lateral subqueries with limit
Next
From: Robert Haas
Date:
Subject: Re: removing global variable ThisTimeLineID