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

PostgreSQL 14 support #13

Closed devrimgunduz closed 1 year ago

devrimgunduz commented 3 years ago

Hi,

v14 entered beta, and pg_store_plans fails to build against v14. Logs are below. Can you please take a look? Regards, Devrim

/usr/lib64/ccache/clang -Wno-ignored-attributes -fno-strict-aliasing -fwrapv -O2 -I. -I./ -I/usr/pgsql-14/include/server -I/usr/pgsql-14/include/internal -D_GNU_SOURCE -I/usr/include/libxml2 -I/usr/include -flto=thin -emit-llvm -c -o pgsp_explain.bc pgsp_explain.c pgsp_explain.c: In function 'pgspExplainTriggers': pgsp_explain.c:69:70: error: 'EState' has no member named 'es_num_result_relations'; did you mean 'es_result_relations'? 69 | int numrels = queryDesc->estate->es_num_result_relations; | ^~~~~~~ | es_result_relations pgsp_explain.c:77:23: warning: assignment to 'ResultRelInfo ' from incompatible pointer type 'ResultRelInfo ' [-Wincompatible-pointer-types] 77 | rInfo = queryDesc->estate->es_result_relations; | ^ make[1]: [: pgsp_explain.o] Error 1 make[1]: Waiting for unfinished jobs.... pg_store_plans.c: In function 'pgsp_ExecutorStart': pg_store_plans.c:713:40: error: too few arguments to function 'InstrAlloc' 713 | queryDesc->totaltime = InstrAlloc(1, INSTRUMENT_ALL); | ^~~~~~ In file included from /usr/pgsql-14/include/server/nodes/execnodes.h:18, from /usr/pgsql-14/include/server/executor/execdesc.h:18, from /usr/pgsql-14/include/server/executor/executor.h:17, from /usr/pgsql-14/include/server/commands/explain.h:16, from pg_store_plans.c:40: /usr/pgsql-14/include/server/executor/instrument.h:88:25: note: declared here 88 | extern Instrumentation InstrAlloc(int n, int instrument_options, | ^~~~~~ pg_store_plans.c: In function 'pg_store_plans': pg_store_plans.c:1043:74: 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); | ^~~~~~~ pg_store_plans.c:1043:74: note: each undeclared identifier is reported only once for each function it appears in make[1]: [: pg_store_plans.o] Error 1 pgsp_explain.c:69:38: error: no member named 'es_num_result_relations' in 'struct EState'; did you mean 'es_result_relations'? int numrels = queryDesc->estate->es_num_result_relations; ^~~~~~~ es_result_relations /usr/pgsql-14/include/server/nodes/execnodes.h:574:18: note: 'es_result_relations' declared here ResultRelInfo es_result_relations; / Array of per-range-table-entry ^ pgsp_explain.c:69:9: warning: incompatible pointer to integer conversion initializing 'int' with an expression of type 'ResultRelInfo ' (aka 'struct ResultRelInfo ') [-Wint-conversion] int numrels = queryDesc->estate->es_num_result_relations; ^ ~~~~~~~~~~ pgsp_explain.c:77:9: warning: incompatible pointer types assigning to 'ResultRelInfo ' (aka 'struct ResultRelInfo ') from 'ResultRelInfo ' (aka 'struct ResultRelInfo *'); dereference with [-Wincompatible-pointer-types] rInfo = queryDesc->estate->es_result_relations; ^ ~~~~~~~~~~ * 2 warnings and 1 error generated. make[1]: *** [/usr/pgsql-14/lib/pgxs/src/makefiles/../../src/Makefile.global:1051: pgsp_explain.bc] Error 1 pg_store_plans.c:713:54: error: too few arguments to function call, expected 3, have 2 queryDesc->totaltime = InstrAlloc(1, INSTRUMENT_ALL);


/usr/pgsql-14/include/server/executor/instrument.h:88:25: note: 'InstrAlloc' declared here
extern Instrumentation *InstrAlloc(int n, int instrument_options,
^
pg_store_plans.c:1043:57: error: use of undeclared identifier 'DEFAULT_ROLE_READ_ALL_STATS'
bool            is_allowed_role = is_member_of_role(GetUserId(), DEFAULT_ROLE_READ_ALL_STATS);
^
2 errors generated.
devrimgunduz commented 3 years ago

ping

devrimgunduz-edb commented 2 years ago

ping.

devrimgunduz commented 2 years ago

ping

idevloo commented 2 years ago

Gentle reminder

devrimgunduz commented 2 years ago

Anyone around? Ping.

yamatattsu commented 2 years ago

Hi All,

Sorry for the late reply. We have started to revise pg_store_plans on PG14 from today. :-D

Regareds, Tatsuro Yamada

idevloo commented 2 years ago

Hi Tatsuro,

Any expected time of arrival ?

How are things progressing ?

Thanks, Ivan

yamatattsu commented 2 years ago

Hi All,

We finished the developing to support PG14. https://github.com/ossc-db/pg_store_plans/commit/5121fd3d0c6a409db1da077f064dd38a0d26f359 If you find any problems, please let us know.

Thanks, Tatsuro Yamada

yamatattsu commented 2 years ago

Hi All,

Sorry, there are wrong commits history on the master branch. I'll let you know when it was fixed.

Regards, Tatsuro Yamada

BillSmith-EDB commented 1 year ago

@yamatattsu @devrimgunduz I'm able to compile pg_store_plans v1.6 & v1.6.1 against PG v14.6. I think this issue can be closed. Thoughts?

yamatattsu commented 1 year ago

@BillSmith-EDB

I have no objection. Thanks!