ossc-db / pg_store_plans

Store execution plans like pg_stat_statements does for queries.
http://ossc-db.github.io/pg_store_plans/
Other
53 stars 26 forks source link

pg_store_plans.c:268:6: error: unknown type name 'QueryEnvironment' #9

Open NgJingRui opened 3 years ago

NgJingRui commented 3 years ago

I am facing this issue when I ran make in the pg_store_plans directory. This issue is faced when I ran it on windows and on Macbook. Does anyone has any suggestions on how this error can be resolved?

x86_64-w64-mingw32-gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -Wno-format-truncation -Wno-stringop-truncation -O2   -I. -I. -I../../src/include -I./src/include/port/win32 -DEXEC_BACKEND  "-I../../src/include/port/win32" -DWIN32_STACK_RLIMIT=4194304  -c -o pg_store_plans.o pg_store_plans.c
pg_store_plans.c:268:6: error: unknown type name 'QueryEnvironment'
  268 |      QueryEnvironment *queryEnv,
      |      ^~~~~~~~~~~~~~~~
pg_store_plans.c: In function '_PG_init':
pg_store_plans.c:434:19: warning: assignment to 'ExecutorRun_hook_type' {aka 'void (*)(QueryDesc *, ScanDirection,  long long unsigned int)'} from incompatible pointer type 'void (*)(QueryDesc *, ScanDirection,  uint64,  bool)' {aka 'void (*)(QueryDesc *, ScanDirection,  long long unsigned int,  char)'} [-Wincompatible-pointer-types]
  434 |  ExecutorRun_hook = pgsp_ExecutorRun;
      |                   ^
pg_store_plans.c:440:24: error: 'pgsp_ProcessUtility' undeclared (first use in this function); did you mean 'prev_ProcessUtility'?
  440 |  ProcessUtility_hook = pgsp_ProcessUtility;
      |                        ^~~~~~~~~~~~~~~~~~~
      |                        prev_ProcessUtility
pg_store_plans.c:440:24: note: each undeclared identifier is reported only once for each function it appears in
pg_store_plans.c: In function 'pgsp_ExecutorRun':
pg_store_plans.c:730:4: error: too many arguments to function 'prev_ExecutorRun'
  730 |    prev_ExecutorRun(queryDesc, direction, count, execute_once);
      |    ^~~~~~~~~~~~~~~~
pg_store_plans.c:732:4: error: too many arguments to function 'standard_ExecutorRun'
  732 |    standard_ExecutorRun(queryDesc, direction, count, execute_once);
      |    ^~~~~~~~~~~~~~~~~~~~
In file included from ../../src/include/commands/explain.h:16,
                 from pg_store_plans.c:40:
../../src/include/executor/executor.h:179:13: note: declared here
  179 | extern void standard_ExecutorRun(QueryDesc *queryDesc,
      |             ^~~~~~~~~~~~~~~~~~~~
pg_store_plans.c: At top level:
pg_store_plans.c:830:6: error: unknown type name 'QueryEnvironment'
  830 |      QueryEnvironment *queryEnv,
      |      ^~~~~~~~~~~~~~~~
pg_store_plans.c: In function 'pg_store_plans':
pg_store_plans.c:1043:57: error: 'DEFAULT_ROLE_READ_ALL_STATS' undeclared (first use in this function)
 1043 |  bool  is_allowed_role = is_member_of_role(GetUserId(), DEFAULT_ROLE_READ_ALL_STATS);
      |                                                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~
make: *** [<builtin>: pg_store_plans.o] Error 1
idevloo commented 2 years ago

Were you able to solve this, I'm facing the same issue.