暂无图片
PG安装pgaudit报错
我来答
分享
R
reddey
2025-05-29
PG安装pgaudit报错

我的操作系统是ORACLE LINUX 8.9,PG数据库是15.3。

[postgres@master pgaudit]$ make install USE_PGXS=1 PG_CONFIG=/home/postgres/training/pgsql/bin/pg_config
gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Wendif-labels -Wmissing-format-attribute -Wimplicit-fallthrough=3 -Wcast-function-type -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -Wno-format-truncation -Wno-stringop-truncation -O2 -fPIC -I. -I./ -I/home/postgres/training/pgsql/include/server -I/home/postgres/training/pgsql/include/internal -D_GNU_SOURCE -c -o pgaudit.o pgaudit.c
pgaudit.c: In function ‘pgaudit_ProcessUtility_hook’:
pgaudit.c:1457:67: error: incompatible type for argument 4 of ‘next_ProcessUtility_hook’
(*next_ProcessUtility_hook) (pstmt, queryString, context, params,
^~~~~~
pgaudit.c:1457:67: note: expected ‘ProcessUtilityContext’ {aka ‘enum <anonymous>’} but argument is of type ‘ParamListInfo’ {aka ‘struct ParamListInfoData *’}
pgaudit.c:1458:38: warning: passing argument 5 of ‘next_ProcessUtility_hook’ from incompatible pointer type [-Wincompatible-pointer-types]
queryEnv, dest, qc);
^~~~~~~~
pgaudit.c:1458:38: note: expected ‘ParamListInfo’ {aka ‘struct ParamListInfoData *’} but argument is of type ‘QueryEnvironment *’ {aka ‘struct QueryEnvironment *’}
pgaudit.c:1458:48: warning: passing argument 6 of ‘next_ProcessUtility_hook’ from incompatible pointer type [-Wincompatible-pointer-types]
queryEnv, dest, qc);
^~~~
pgaudit.c:1458:48: note: expected ‘QueryEnvironment *’ {aka ‘struct QueryEnvironment *’} but argument is of type ‘DestReceiver *’ {aka ‘struct _DestReceiver *’}
pgaudit.c:1458:54: warning: passing argument 7 of ‘next_ProcessUtility_hook’ from incompatible pointer type [-Wincompatible-pointer-types]
queryEnv, dest, qc);
^~
pgaudit.c:1458:54: note: expected ‘DestReceiver *’ {aka ‘struct _DestReceiver *’} but argument is of type ‘QueryCompletion *’ {aka ‘struct QueryCompletion *’}
pgaudit.c:1457:10: error: too few arguments to function ‘next_ProcessUtility_hook’
(*next_ProcessUtility_hook) (pstmt, queryString, context, params,
~^~~~~~~~~~~~~~~~~~~~~~~~~~
pgaudit.c:1460:62: error: incompatible type for argument 4 of ‘standard_ProcessUtility’
standard_ProcessUtility(pstmt, queryString, context, params,
^~~~~~
In file included from pgaudit.c:29:
/home/postgres/training/pgsql/include/server/tcop/utility.h:87:32: note: expected ‘ProcessUtilityContext’ {aka ‘enum <anonymous>’} but argument is of type ‘ParamListInfo’ {aka ‘struct ParamListInfoData *’}
ProcessUtilityContext context, ParamListInfo params,
~~~~~~~~~~~~~~~~~~~~~~^~~~~~~
pgaudit.c:1461:33: warning: passing argument 5 of ‘standard_ProcessUtility’ from incompatible pointer type [-Wincompatible-pointer-types]
queryEnv, dest, qc);
^~~~~~~~
In file included from pgaudit.c:29:
/home/postgres/training/pgsql/include/server/tcop/utility.h:87:55: note: expected ‘ParamListInfo’ {aka ‘struct ParamListInfoData *’} but argument is of type ‘QueryEnvironment *’ {aka ‘struct QueryEnvironment *’}
ProcessUtilityContext context, ParamListInfo params,
~~~~~~~~~~~~~~^~~~~~
pgaudit.c:1461:43: warning: passing argument 6 of ‘standard_ProcessUtility’ from incompatible pointer type [-Wincompatible-pointer-types]
queryEnv, dest, qc);
^~~~
In file included from pgaudit.c:29:
/home/postgres/training/pgsql/include/server/tcop/utility.h:88:28: note: expected ‘QueryEnvironment *’ {aka ‘struct QueryEnvironment *’} but argument is of type ‘DestReceiver *’ {aka ‘struct _DestReceiver *’}
QueryEnvironment *queryEnv,
~~~~~~~~~~~~~~~~~~^~~~~~~~
pgaudit.c:1461:49: warning: passing argument 7 of ‘standard_ProcessUtility’ from incompatible pointer type [-Wincompatible-pointer-types]
queryEnv, dest, qc);
^~
In file included from pgaudit.c:29:
/home/postgres/training/pgsql/include/server/tcop/utility.h:89:24: note: expected ‘DestReceiver *’ {aka ‘struct _DestReceiver *’} but argument is of type ‘QueryCompletion *’ {aka ‘struct QueryCompletion *’}
DestReceiver *dest, QueryCompletion *qc);
~~~~~~~~~~~~~~^~~~
pgaudit.c:1460:9: error: too few arguments to function ‘standard_ProcessUtility’
standard_ProcessUtility(pstmt, queryString, context, params,
^~~~~~~~~~~~~~~~~~~~~~~
In file included from pgaudit.c:29:
/home/postgres/training/pgsql/include/server/tcop/utility.h:85:13: note: declared here
extern void standard_ProcessUtility(PlannedStmt *pstmt, const char *queryString,
^~~~~~~~~~~~~~~~~~~~~~~
pgaudit.c: In function ‘_PG_init’:
pgaudit.c:2053:25: warning: assignment to ‘ProcessUtility_hook_type’ {aka ‘void (*)(struct PlannedStmt *, const char *, _Bool, enum <anonymous>, struct ParamListInfoData *, struct QueryEnvironment *, struct _DestReceiver *, struct QueryCompletion *)’} from incompatible pointer type ‘void (*)(PlannedStmt *, const char *, ProcessUtilityContext, struct ParamListInfoData *, QueryEnvironment *, DestReceiver *, QueryCompletion *)’ {aka ‘void (*)(struct PlannedStmt *, const char *, enum <anonymous>, struct ParamListInfoData *, struct QueryEnvironment *, struct _DestReceiver *, struct QueryCompletion *)’} [-Wincompatible-pointer-types]
ProcessUtility_hook = pgaudit_ProcessUtility_hook;
^
make: *** [<builtin>: pgaudit.o] Error 1

我来答
添加附件
收藏
分享
问题补充
2条回答
默认
最新
R
reddey

后来换数据库PG版本为17后,故障解决了。

暂无图片 评论
暂无图片 有用 1
伟鹏

pgaudit版本不匹配
获取适合PostgreSQL 15.3版本的pgaudit
pgaudit可以参考:https://github.com/pgaudit/pgaudit

最后再尝试执行一下:
make install USE_PGXS=1 PG_CONFIG=/home/postgres/training/pgsql/bin/pg_config

暂无图片 评论
暂无图片 有用 1
回答交流
提交
问题信息
请登录之后查看
邀请回答
暂无人订阅该标签,敬请期待~~
暂无图片墨值悬赏