Skip to content

support for postgres 18 #566

@sebastianwebber

Description

@sebastianwebber

Description

Postgres 18 was released today and the extension doesn't not build against postgres 18.

Expected Results

make all run without errors

Actual Results

make all fails:

root@221f91773525:/build/pg_stat_monitor# git checkout "${PG_STAT_MONITOR}"
Note: switching to '2.1.0'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by switching back to a branch.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -c with the switch command. Example:

  git switch -c <new-branch-name>

Or undo this operation with:

  git switch -

Turn off this advice by setting config variable advice.detachedHead to false

HEAD is now at 0c50b23 Prepare release 2.1.0 (#482)
root@221f91773525:/build/pg_stat_monitor# PATH="/usr/lib/postgresql/18/bin:${PATH}" make USE_PGXS=1 clear
make: *** No rule to make target 'clear'.  Stop.
root@221f91773525:/build/pg_stat_monitor# PATH="/usr/lib/postgresql/18/bin:${PATH}" make USE_PGXS=1 clean
rm -f pg_stat_monitor.so   libpg_stat_monitor.a  libpg_stat_monitor.pc
rm -f hash_query.o guc.o pg_stat_monitor.o  hash_query.bc guc.bc pg_stat_monitor.bc
rm -rf results/ regression.diffs regression.out tmp_check/ tmp_check_iso/ log/ output_iso/
rm -rf tmp_check/
root@221f91773525:/build/pg_stat_monitor# PATH="/usr/lib/postgresql/18/bin:${PATH}" make USE_PGXS=1 all
gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Wendif-labels -Wmissing-format-attribute -Wimplicit-fallthrough=3 -Wcast-function-type -Wshadow=compatible-local -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -Wno-format-truncation -Wno-stringop-truncation -g -g -O2 -flto=auto -ffat-lto-objects -flto=auto -ffat-lto-objects -fstack-protector-strong -Wformat -Werror=format-security -fPIC -fvisibility=hidden -I. -I./ -I/usr/include/postgresql/18/server -I/usr/include/postgresql/internal -Wdate-time -D_FORTIFY_SOURCE=2 -D_GNU_SOURCE  -I/usr/include/libxml2     -c -o hash_query.o hash_query.c
gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Wendif-labels -Wmissing-format-attribute -Wimplicit-fallthrough=3 -Wcast-function-type -Wshadow=compatible-local -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -Wno-format-truncation -Wno-stringop-truncation -g -g -O2 -flto=auto -ffat-lto-objects -flto=auto -ffat-lto-objects -fstack-protector-strong -Wformat -Werror=format-security -fPIC -fvisibility=hidden -I. -I./ -I/usr/include/postgresql/18/server -I/usr/include/postgresql/internal -Wdate-time -D_FORTIFY_SOURCE=2 -D_GNU_SOURCE  -I/usr/include/libxml2     -c -o guc.o guc.c
gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Wendif-labels -Wmissing-format-attribute -Wimplicit-fallthrough=3 -Wcast-function-type -Wshadow=compatible-local -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -Wno-format-truncation -Wno-stringop-truncation -g -g -O2 -flto=auto -ffat-lto-objects -flto=auto -ffat-lto-objects -fstack-protector-strong -Wformat -Werror=format-security -fPIC -fvisibility=hidden -I. -I./ -I/usr/include/postgresql/18/server -I/usr/include/postgresql/internal -Wdate-time -D_FORTIFY_SOURCE=2 -D_GNU_SOURCE  -I/usr/include/libxml2     -c -o pg_stat_monitor.o pg_stat_monitor.c
pg_stat_monitor.c: In function '_PG_init':
pg_stat_monitor.c:328:26: warning: assignment to 'ExecutorRun_hook_type' {aka 'void (*)(QueryDesc *, ScanDirection,  long unsigned int)'} from incompatible pointer type 'void (*)(QueryDesc *, ScanDirection,  uint64,  _Bool)' {aka 'void (*)(QueryDesc *, ScanDirection,  long unsigned int,  _Bool)'} [-Wincompatible-pointer-types]
  328 |         ExecutorRun_hook = HOOK(pgsm_ExecutorRun);
      |                          ^
pg_stat_monitor.c: In function 'pgsm_ExecutorRun':
pg_stat_monitor.c:612:25: error: too many arguments to function 'prev_ExecutorRun'
  612 |                         prev_ExecutorRun(queryDesc, direction, count, execute_once);
      |                         ^~~~~~~~~~~~~~~~
pg_stat_monitor.c:614:25: error: too many arguments to function 'standard_ExecutorRun'
  614 |                         standard_ExecutorRun(queryDesc, direction, count, execute_once);
      |                         ^~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/postgresql/18/server/commands/explain.h:16,
                 from pg_stat_monitor.c:25:
/usr/include/postgresql/18/server/executor/executor.h:235:13: note: declared here
  235 | extern void standard_ExecutorRun(QueryDesc *queryDesc,
      |             ^~~~~~~~~~~~~~~~~~~~
pg_stat_monitor.c: In function 'pgsm_explain':
pg_stat_monitor.c:667:9: error: unknown type name 'ExplainState'; use 'struct' keyword to refer to the type
  667 |         ExplainState *es = NewExplainState();
      |         ^~~~~~~~~~~~
      |         struct
pg_stat_monitor.c:667:28: warning: implicit declaration of function 'NewExplainState' [-Wimplicit-function-declaration]
  667 |         ExplainState *es = NewExplainState();
      |                            ^~~~~~~~~~~~~~~
pg_stat_monitor.c:667:28: warning: initialization of 'int *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
pg_stat_monitor.c:669:11: error: request for member 'buffers' in something not a structure or union
  669 |         es->buffers = false;
      |           ^~
pg_stat_monitor.c:670:11: error: request for member 'analyze' in something not a structure or union
  670 |         es->analyze = false;
      |           ^~
pg_stat_monitor.c:671:11: error: request for member 'verbose' in something not a structure or union
  671 |         es->verbose = false;
      |           ^~
pg_stat_monitor.c:672:11: error: request for member 'costs' in something not a structure or union
  672 |         es->costs = false;
      |           ^~
pg_stat_monitor.c:673:11: error: request for member 'format' in something not a structure or union
  673 |         es->format = EXPLAIN_FORMAT_TEXT;
      |           ^~
pg_stat_monitor.c:673:22: error: 'EXPLAIN_FORMAT_TEXT' undeclared (first use in this function)
  673 |         es->format = EXPLAIN_FORMAT_TEXT;
      |                      ^~~~~~~~~~~~~~~~~~~
pg_stat_monitor.c:673:22: note: each undeclared identifier is reported only once for each function it appears in
pg_stat_monitor.c:675:9: warning: implicit declaration of function 'ExplainBeginOutput' [-Wimplicit-function-declaration]
  675 |         ExplainBeginOutput(es);
      |         ^~~~~~~~~~~~~~~~~~
pg_stat_monitor.c:676:26: warning: passing argument 1 of 'ExplainPrintPlan' from incompatible pointer type [-Wincompatible-pointer-types]
  676 |         ExplainPrintPlan(es, queryDesc);
      |                          ^~
      |                          |
      |                          int *
In file included from pg_stat_monitor.c:25:
/usr/include/postgresql/18/server/commands/explain.h:73:51: note: expected 'struct ExplainState *' but argument is of type 'int *'
   73 | extern void ExplainPrintPlan(struct ExplainState *es, QueryDesc *queryDesc);
      |                              ~~~~~~~~~~~~~~~~~~~~~^~
pg_stat_monitor.c:677:9: warning: implicit declaration of function 'ExplainEndOutput' [-Wimplicit-function-declaration]
  677 |         ExplainEndOutput(es);
      |         ^~~~~~~~~~~~~~~~
pg_stat_monitor.c:679:15: error: request for member 'str' in something not a structure or union
  679 |         if (es->str->len > 0 && es->str->data[es->str->len - 1] == '\n')
      |               ^~
pg_stat_monitor.c:679:35: error: request for member 'str' in something not a structure or union
  679 |         if (es->str->len > 0 && es->str->data[es->str->len - 1] == '\n')
      |                                   ^~
pg_stat_monitor.c:679:49: error: request for member 'str' in something not a structure or union
  679 |         if (es->str->len > 0 && es->str->data[es->str->len - 1] == '\n')
      |                                                 ^~
pg_stat_monitor.c:680:19: error: request for member 'str' in something not a structure or union
  680 |                 es->str->data[--es->str->len] = '\0';
      |                   ^~
pg_stat_monitor.c:680:35: error: request for member 'str' in something not a structure or union
  680 |                 es->str->data[--es->str->len] = '\0';
      |                                   ^~
pg_stat_monitor.c:681:18: error: request for member 'str' in something not a structure or union
  681 |         return es->str->data;
      |                  ^~
pg_stat_monitor.c:682:1: warning: control reaches end of non-void function [-Wreturn-type]
  682 | }
      | ^
make: *** [<builtin>: pg_stat_monitor.o] Error 1

Version

root@221f91773525:/build/pg_stat_monitor# psql --version
psql (PostgreSQL) 18.0 (Ubuntu 18.0-1.pgdg22.04+3)
root@221f91773525:/build/pg_stat_monitor# cat /etc/os-release
PRETTY_NAME="Ubuntu 22.04.5 LTS"
NAME="Ubuntu"
VERSION_ID="22.04"
VERSION="22.04.5 LTS (Jammy Jellyfish)"
VERSION_CODENAME=jammy
ID=ubuntu
ID_LIKE=debian
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
UBUNTU_CODENAME=jammy

Steps to reproduce

  1. checkout repo on latest tag
  2. make clean
  3. make all

Relevant logs

Code of Conduct

  • I agree to follow Percona Community Code of Conduct

Metadata

Metadata

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions