Skip to content

PostgreSQL 19 support #773

Description

@devrimgunduz

Description

Hi,

git head fails to build against PG 19. Logs are below. Can you please take a look? v19 beta2 is due next week.

Thanks! Devrim

Per: pgdg-packaging/pgdg-rpms#213

/usr/bin/clang -Wno-ignored-attributes -fno-strict-aliasing -fwrapv -fexcess-precision=standard -Wno-unused-command-line-argument -Wno-compound-token-split-by-macro -Wno-format-truncation -O2  -I. -I./ -I/usr/pgsql-19/include/server -I/usr/pgsql-19/include/internal -D_GNU_SOURCE  -I/usr/include -I/usr/include/libxml2 -DWITH_GZFILEOP    -flto=thin -emit-llvm -c -o src/pg_stat_monitor.bc src/pg_stat_monitor.c
In file included from src/hash_query.h:25,
                 from src/hash_query.c:21:
src/hash_query.c: In function ‘pgsm_startup’:
src/hash_query.c:101:67: error: too few arguments to function ‘LWLockNewTrancheId’; expected 1, have 0
  101 |                                                                   LWLockNewTrancheId(), 0);
      |                                                                   ^~~~~~~~~~~~~~~~~~
/usr/pgsql-19/include/server/utils/dsa.h:123:46: note: in definition of macro ‘dsa_create_in_place’
  123 |         dsa_create_in_place_ext(place, size, tranche_id, segment, \
      |                                              ^~~~~~~~~~
In file included from src/hash_query.h:23:
/usr/pgsql-19/include/server/storage/lwlock.h:148:17: note: declared here
  148 | extern int      LWLockNewTrancheId(const char *name);
      |                 ^~~~~~~~~~~~~~~~~~
src/hash_query.c: In function ‘pgsm_create_bucket_hash’:
src/hash_query.h:41:50: error: passing argument 3 of ‘ShmemInitHash’ makes pointer from integer without a cast [-Wint-conversion]
   41 | #define MAX_BUCKET_ENTRIES      (MAX_BUCKETS_MEM / sizeof(pgsmEntry))
      |                                 ~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~
      |                                                  |
      |                                                  long unsigned int
src/hash_query.c:141:87: note: in expansion of macro ‘MAX_BUCKET_ENTRIES’
  141 |         return ShmemInitHash("pg_stat_monitor: bucket hashtable", MAX_BUCKET_ENTRIES, MAX_BUCKET_ENTRIES, &info, HASH_ELEM | HASH_BLOBS);
      |                                                                                       ^~~~~~~~~~~~~~~~~~
In file included from src/hash_query.c:18:
/usr/pgsql-19/include/server/storage/shmem.h:188:61: note: expected ‘HASHCTL *’ but argument is of type ‘long unsigned int’
  188 |                                                    HASHCTL *infoP, int hash_flags);
      |                                                    ~~~~~~~~~^~~~~
src/hash_query.c:141:107: error: passing argument 4 of ‘ShmemInitHash’ makes integer from pointer without a cast [-Wint-conversion]
  141 |         return ShmemInitHash("pg_stat_monitor: bucket hashtable", MAX_BUCKET_ENTRIES, MAX_BUCKET_ENTRIES, &info, HASH_ELEM | HASH_BLOBS);
      |                                                                                                           ^~~~~
      |                                                                                                           |
      |                                                                                                           HASHCTL *
/usr/pgsql-19/include/server/storage/shmem.h:188:72: note: expected ‘int’ but argument is of type ‘HASHCTL *’
  188 |                                                    HASHCTL *infoP, int hash_flags);
      |                                                                    ~~~~^~~~~~~~~~
src/hash_query.c:141:16: error: too many arguments to function ‘ShmemInitHash’; expected 4, have 5
  141 |         return ShmemInitHash("pg_stat_monitor: bucket hashtable", MAX_BUCKET_ENTRIES, MAX_BUCKET_ENTRIES, &info, HASH_ELEM | HASH_BLOBS);
      |                ^~~~~~~~~~~~~
/usr/pgsql-19/include/server/storage/shmem.h:187:14: note: declared here
  187 | extern HTAB *ShmemInitHash(const char *name, int64 nelems,
      |              ^~~~~~~~~~~~~
make: *** [<builtin>: src/hash_query.o] Error 1
make: *** Waiting for unfinished jobs....
src/hash_query.c:101:30: error: too few arguments to function call, single argument 'name' was not specified
  101 |                                                                   LWLockNewTrancheId(), 0);
      |                                                                   ~~~~~~~~~~~~~~~~~~ ^
/usr/pgsql-19/include/server/storage/lwlock.h:148:12: note: 'LWLockNewTrancheId' declared here
  148 | extern int      LWLockNewTrancheId(const char *name);
      |                 ^                  ~~~~~~~~~~~~~~~~
src/hash_query.c:141:107: error: too many arguments to function call, expected 4, have 5
  141 |         return ShmemInitHash("pg_stat_monitor: bucket hashtable", MAX_BUCKET_ENTRIES, MAX_BUCKET_ENTRIES, &info, HASH_ELEM | HASH_BLOBS);
      |                ~~~~~~~~~~~~~                                                                                     ^~~~~~~~~~~~~~~~~~~~~~
/usr/pgsql-19/include/server/utils/hsearch.h:90:20: note: expanded from macro 'HASH_ELEM'
   90 | #define HASH_ELEM               0x0008  /* Set keysize and entrysize (now required!) */
      |                                 ^
/usr/pgsql-19/include/server/storage/shmem.h:187:14: note: 'ShmemInitHash' declared here
  187 | extern HTAB *ShmemInitHash(const char *name, int64 nelems,
      |              ^             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  188 |                                                    HASHCTL *infoP, int hash_flags);
      |                                                    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2 errors generated.
make: *** [/usr/pgsql-19/lib/pgxs/src/makefiles/../../src/Makefile.global:1103: src/hash_query.bc] Error 1
src/pg_stat_monitor.c:315:26: error: incompatible function pointer types assigning to 'post_parse_analyze_hook_type' (aka 'void (*)(struct ParseState *, struct Query *, const struct JumbleState *)') from
      'void (ParseState *, Query *, JumbleState *)' (aka 'void (struct ParseState *, struct Query *, struct JumbleState *)') [-Wincompatible-function-pointer-types]
  315 |         post_parse_analyze_hook = pgsm_post_parse_analyze;
      |                                 ^ ~~~~~~~~~~~~~~~~~~~~~~~
src/pg_stat_monitor.c:327:15: error: incompatible function pointer types assigning to 'planner_hook_type' (aka 'struct PlannedStmt *(*)(struct Query *, const char *, int, struct ParamListInfoData *, struct
      ExplainState *)') from 'PlannedStmt *(Query *, const char *, int, ParamListInfo)' (aka 'struct PlannedStmt *(struct Query *, const char *, int, struct ParamListInfoData *)')
      [-Wincompatible-function-pointer-types]
  327 |         planner_hook = pgsm_planner_hook;
      |                      ^ ~~~~~~~~~~~~~~~~~
src/pg_stat_monitor.c:556:18: error: no member named 'totaltime' in 'struct QueryDesc'
  556 |                 if (queryDesc->totaltime == NULL)
      |                     ~~~~~~~~~  ^
src/pg_stat_monitor.c:561:15: error: no member named 'totaltime' in 'struct QueryDesc'
  561 |                         queryDesc->totaltime = InstrAlloc(1, INSTRUMENT_ALL, false);
      |                         ~~~~~~~~~  ^
src/pg_stat_monitor.c:561:41: error: too many arguments to function call, expected single argument 'instrument_options', have 3 arguments
  561 |                         queryDesc->totaltime = InstrAlloc(1, INSTRUMENT_ALL, false);
      |                                                ~~~~~~~~~~    ^~~~~~~~~~~~~~~~~~~~~
/usr/pgsql-19/include/server/executor/instrument.h:131:25: note: 'InstrAlloc' declared here
  131 | extern Instrumentation *InstrAlloc(int instrument_options);
      |                         ^          ~~~~~~~~~~~~~~~~~~~~~~
src/pg_stat_monitor.c:702:45: error: no member named 'totaltime' in 'struct QueryDesc'
  702 |         if (queryId != INT64CONST(0) && queryDesc->totaltime && pgsm_enabled(nesting_level))
      |                                         ~~~~~~~~~  ^
src/pg_stat_monitor.c:717:27: error: no member named 'totaltime' in 'struct QueryDesc'
  717 |                 InstrEndLoop(queryDesc->totaltime);
      |                              ~~~~~~~~~  ^
src/pg_stat_monitor.c:731:20: error: no member named 'totaltime' in 'struct QueryDesc'
  731 |                                                   queryDesc->totaltime->total * 1000.0, /* exec_total_time */
      |                                                   ~~~~~~~~~  ^
src/pg_stat_monitor.c:733:21: error: no member named 'totaltime' in 'struct QueryDesc'
  733 |                                                   &queryDesc->totaltime->bufusage,      /* bufusage */
      |                                                    ~~~~~~~~~  ^
src/pg_stat_monitor.c:734:21: error: no member named 'totaltime' in 'struct QueryDesc'
  734 |                                                   &queryDesc->totaltime->walusage,      /* walusage */
      |                                                    ~~~~~~~~~  ^
src/pg_stat_monitor.c:891:79: error: too few arguments to function call, expected 5, have 4
  891 |                                 result = planner_hook_next(parse, query_string, cursorOptions, boundParams);
      |                                          ~~~~~~~~~~~~~~~~~                                                ^
src/pg_stat_monitor.c:893:78: error: too few arguments to function call, expected 5, have 4
  893 |                                 result = standard_planner(parse, query_string, cursorOptions, boundParams);
      |                                          ~~~~~~~~~~~~~~~~                                                ^
/usr/pgsql-19/include/server/optimizer/planner.h:58:21: note: 'standard_planner' declared here
   58 | extern PlannedStmt *standard_planner(Query *parse, const char *query_string,
      |                     ^                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   59 |                                                                          int cursorOptions,
      |                                                                          ~~~~~~~~~~~~~~~~~~
   60 |                                                                          ParamListInfo boundParams,
      |                                                                          ~~~~~~~~~~~~~~~~~~~~~~~~~~
   61 |                                                                          ExplainState *es);
      |                                                                          ~~~~~~~~~~~~~~~~
src/pg_stat_monitor.c:955:79: error: too few arguments to function call, expected 5, have 4
  955 |                                 result = planner_hook_next(parse, query_string, cursorOptions, boundParams);
      |                                          ~~~~~~~~~~~~~~~~~                                                ^
src/pg_stat_monitor.c:957:78: error: too few arguments to function call, expected 5, have 4
  957 |                                 result = standard_planner(parse, query_string, cursorOptions, boundParams);
      |                                          ~~~~~~~~~~~~~~~~                                                ^
/usr/pgsql-19/include/server/optimizer/planner.h:58:21: note: 'standard_planner' declared here
   58 | extern PlannedStmt *standard_planner(Query *parse, const char *query_string,
      |                     ^                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   59 |                                                                          int cursorOptions,
      |                                                                          ~~~~~~~~~~~~~~~~~~
   60 |                                                                          ParamListInfo boundParams,
      |                                                                          ~~~~~~~~~~~~~~~~~~~~~~~~~~
   61 |                                                                          ExplainState *es);
      |                                                                          ~~~~~~~~~~~~~~~~
src/pg_stat_monitor.c:2048:13: error: call to undeclared function 'tuplestore_begin_heap'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
 2048 |         tupstore = tuplestore_begin_heap(true, false, work_mem);
      |                    ^
src/pg_stat_monitor.c:2048:11: error: incompatible integer to pointer conversion assigning to 'Tuplestorestate *' (aka 'struct Tuplestorestate *') from 'int' [-Wint-conversion]
 2048 |         tupstore = tuplestore_begin_heap(true, false, work_mem);
      |                  ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/pg_stat_monitor.c:2412:3: error: call to undeclared function 'tuplestore_putvalues'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
 2412 |                 tuplestore_putvalues(tupstore, tupdesc, values, nulls);
      |                 ^
src/pg_stat_monitor.c:2841:10: error: no member named 'escape_string_warning' in 'struct core_yy_extra_type'
 2841 |         yyextra.escape_string_warning = false;
      |         ~~~~~~~ ^
18 errors generated.
make: *** [/usr/pgsql-19/lib/pgxs/src/makefiles/../../src/Makefile.global:1103: src/pg_stat_monitor.bc] Error 1
src/pg_stat_monitor.c: In function ‘_PG_init’:
src/pg_stat_monitor.c:315:33: error: assignment to ‘post_parse_analyze_hook_type’ {aka ‘void (*)(ParseState *, Query *, const JumbleState *)’} from incompatible pointer type ‘void (*)(ParseState *, Query *, JumbleState *)’ [-Wincompatible-pointer-types]
  315 |         post_parse_analyze_hook = pgsm_post_parse_analyze;
      |                                 ^
src/pg_stat_monitor.c:171:13: note: ‘pgsm_post_parse_analyze’ declared here
  171 | static void pgsm_post_parse_analyze(ParseState *pstate, Query *query, JumbleState *jstate);
      |             ^~~~~~~~~~~~~~~~~~~~~~~
In file included from src/pg_stat_monitor.c:37:
/usr/pgsql-19/include/server/parser/analyze.h:22:16: note: ‘post_parse_analyze_hook_type’ declared here
   22 | typedef void (*post_parse_analyze_hook_type) (ParseState *pstate,
      |                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/pg_stat_monitor.c:327:22: error: assignment to ‘planner_hook_type’ {aka ‘PlannedStmt * (*)(Query *, const char *, int,  struct ParamListInfoData *, ExplainState *)’} from incompatible pointer type ‘PlannedStmt * (*)(Query *, const char *, int,  struct ParamListInfoData *)’ [-Wincompatible-pointer-types]
  327 |         planner_hook = pgsm_planner_hook;
      |                      ^
src/pg_stat_monitor.c:185:21: note: ‘pgsm_planner_hook’ declared here
  185 | static PlannedStmt *pgsm_planner_hook(Query *parse, const char *query_string,
      |                     ^~~~~~~~~~~~~~~~~
In file included from src/pg_stat_monitor.c:36:
/usr/pgsql-19/include/server/optimizer/planner.h:28:24: note: ‘planner_hook_type’ declared here
   28 | typedef PlannedStmt *(*planner_hook_type) (Query *parse,
      |                        ^~~~~~~~~~~~~~~~~
src/pg_stat_monitor.c: In function ‘pgsm_ExecutorStart’:
src/pg_stat_monitor.c:556:30: error: ‘QueryDesc’ has no member named ‘totaltime’
  556 |                 if (queryDesc->totaltime == NULL)
      |                              ^~
src/pg_stat_monitor.c:561:34: error: ‘QueryDesc’ has no member named ‘totaltime’
  561 |                         queryDesc->totaltime = InstrAlloc(1, INSTRUMENT_ALL, false);
      |                                  ^~
src/pg_stat_monitor.c:561:48: error: too many arguments to function ‘InstrAlloc’; expected 1, have 3
  561 |                         queryDesc->totaltime = InstrAlloc(1, INSTRUMENT_ALL, false);
      |                                                ^~~~~~~~~~    ~~~~~~~~~~~~~~
In file included from /usr/pgsql-19/include/server/commands/explain.h:17,
                 from src/pg_stat_monitor.c:28:
/usr/pgsql-19/include/server/executor/instrument.h:131:25: note: declared here
  131 | extern Instrumentation *InstrAlloc(int instrument_options);
      |                         ^~~~~~~~~~
src/pg_stat_monitor.c: In function ‘pgsm_ExecutorEnd’:
src/pg_stat_monitor.c:702:50: error: ‘QueryDesc’ has no member named ‘totaltime’
  702 |         if (queryId != INT64CONST(0) && queryDesc->totaltime && pgsm_enabled(nesting_level))
      |                                                  ^~
src/pg_stat_monitor.c:717:39: error: ‘QueryDesc’ has no member named ‘totaltime’
  717 |                 InstrEndLoop(queryDesc->totaltime);
      |                                       ^~
src/pg_stat_monitor.c:731:60: error: ‘QueryDesc’ has no member named ‘totaltime’
  731 |                                                   queryDesc->totaltime->total * 1000.0, /* exec_total_time */
      |                                                            ^~
src/pg_stat_monitor.c:733:61: error: ‘QueryDesc’ has no member named ‘totaltime’
  733 |                                                   &queryDesc->totaltime->bufusage,      /* bufusage */
      |                                                             ^~
src/pg_stat_monitor.c:734:61: error: ‘QueryDesc’ has no member named ‘totaltime’
  734 |                                                   &queryDesc->totaltime->walusage,      /* walusage */
      |                                                             ^~
src/pg_stat_monitor.c: In function ‘pgsm_planner_hook’:
src/pg_stat_monitor.c:891:42: error: too few arguments to function ‘planner_hook_next’; expected 5, have 4
  891 |                                 result = planner_hook_next(parse, query_string, cursorOptions, boundParams);
      |                                          ^~~~~~~~~~~~~~~~~
src/pg_stat_monitor.c:893:42: error: too few arguments to function ‘standard_planner’; expected 5, have 4
  893 |                                 result = standard_planner(parse, query_string, cursorOptions, boundParams);
      |                                          ^~~~~~~~~~~~~~~~
/usr/pgsql-19/include/server/optimizer/planner.h:58:21: note: declared here
   58 | extern PlannedStmt *standard_planner(Query *parse, const char *query_string,
      |                     ^~~~~~~~~~~~~~~~
src/pg_stat_monitor.c:955:42: error: too few arguments to function ‘planner_hook_next’; expected 5, have 4
  955 |                                 result = planner_hook_next(parse, query_string, cursorOptions, boundParams);
      |                                          ^~~~~~~~~~~~~~~~~
src/pg_stat_monitor.c:957:42: error: too few arguments to function ‘standard_planner’; expected 5, have 4
  957 |                                 result = standard_planner(parse, query_string, cursorOptions, boundParams);
      |                                          ^~~~~~~~~~~~~~~~
/usr/pgsql-19/include/server/optimizer/planner.h:58:21: note: declared here
   58 | extern PlannedStmt *standard_planner(Query *parse, const char *query_string,
      |                     ^~~~~~~~~~~~~~~~
src/pg_stat_monitor.c: In function ‘pg_stat_monitor_internal’:
src/pg_stat_monitor.c:2048:20: error: implicit declaration of function ‘tuplestore_begin_heap’ [-Wimplicit-function-declaration]
 2048 |         tupstore = tuplestore_begin_heap(true, false, work_mem);
      |                    ^~~~~~~~~~~~~~~~~~~~~
src/pg_stat_monitor.c:2048:18: error: assignment to ‘Tuplestorestate *’ from ‘int’ makes pointer from integer without a cast [-Wint-conversion]
 2048 |         tupstore = tuplestore_begin_heap(true, false, work_mem);
      |                  ^
src/pg_stat_monitor.c:2412:17: error: implicit declaration of function ‘tuplestore_putvalues’ [-Wimplicit-function-declaration]
 2412 |                 tuplestore_putvalues(tupstore, tupdesc, values, nulls);
      |                 ^~~~~~~~~~~~~~~~~~~~
src/pg_stat_monitor.c: In function ‘fill_in_constant_lengths’:
src/pg_stat_monitor.c:2841:16: error: ‘core_yy_extra_type’ has no member named ‘escape_string_warning’
 2841 |         yyextra.escape_string_warning = false;
      |                ^

Expected Results

Build should be fine

Actual Results

See above

Version

PostgreSQL 19 beta1, GCC 16.

Steps to reproduce

No response

Relevant logs

Code of Conduct

  • I agree to follow Percona Community Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    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