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

Ubuntu 20.04 installation #20

Closed mixmind closed 2 years ago

mixmind commented 2 years ago

Hi,

I'm trying to compile and install this extension in Ubuntu 20.04 on postgresql 11 and facing some issues. I have installed postgresql-11 and postgresql-server-dev-11 Providing here logs

make USE_PGXS=1
$ make USE_PGXS=1 
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 -g -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -fno-omit-frame-pointer -fPIC -fPIC -I. -I./ -I/usr/include/postgresql/11/server -I/usr/include/postgresql/internal  -Wdate-time -D_FORTIFY_SOURCE=2 -D_GNU_SOURCE -I/usr/include/libxml2  -I/usr/include/mit-krb5  -c -o pg_store_plans.o pg_store_plans.c
In file included from /usr/include/postgresql/11/server/access/skey.h:19,
                 from /usr/include/postgresql/11/server/access/genam.h:18,
                 from /usr/include/postgresql/11/server/nodes/execnodes.h:17,
                 from /usr/include/postgresql/11/server/executor/execdesc.h:18,
                 from /usr/include/postgresql/11/server/executor/executor.h:17,
                 from /usr/include/postgresql/11/server/commands/explain.h:16,
                 from pg_store_plans.c:41:
pg_store_plans.c: In function ‘pg_store_plans_info’:
pg_store_plans.c:1631:36: warning: implicit declaration of function ‘heap_form_tuple’; did you mean ‘heap_lock_tuple’? [-Wimplicit-function-declaration]
 1631 |  PG_RETURN_DATUM(HeapTupleGetDatum(heap_form_tuple(tupdesc, values, nulls)));
      |                                    ^~~~~~~~~~~~~~~
/usr/include/postgresql/11/server/fmgr.h:323:37: note: in definition of macro ‘PG_RETURN_DATUM’
  323 | #define PG_RETURN_DATUM(x)  return (x)
      |                                     ^
pg_store_plans.c:1631:18: note: in expansion of macro ‘HeapTupleGetDatum’
 1631 |  PG_RETURN_DATUM(HeapTupleGetDatum(heap_form_tuple(tupdesc, values, nulls)));
      |                  ^~~~~~~~~~~~~~~~~
/usr/include/postgresql/11/server/funcapi.h:231:66: error: invalid type argument of ‘->’ (have ‘int’)
  231 | #define HeapTupleGetDatum(tuple)  HeapTupleHeaderGetDatum((tuple)->t_data)
      |                                                                  ^~
/usr/include/postgresql/11/server/fmgr.h:323:37: note: in definition of macro ‘PG_RETURN_DATUM’
  323 | #define PG_RETURN_DATUM(x)  return (x)
      |                                     ^
pg_store_plans.c:1631:18: note: in expansion of macro ‘HeapTupleGetDatum’
 1631 |  PG_RETURN_DATUM(HeapTupleGetDatum(heap_form_tuple(tupdesc, values, nulls)));
      |                  ^~~~~~~~~~~~~~~~~
pg_store_plans.c: In function ‘ptext_store’:
pg_store_plans.c:1842:6: warning: implicit declaration of function ‘pg_pwrite’; did you mean ‘pwrite’? [-Wimplicit-function-declaration]
 1842 |  if (pg_pwrite(fd, plan, plan_len, off) != plan_len)
      |      ^~~~~~~~~
      |      pwrite
pg_store_plans.c: In function ‘pg_store_plans_info’:
pg_store_plans.c:1632:1: warning: control reaches end of non-void function [-Wreturn-type]
 1632 | }
      | ^
make: *** [: pg_store_plans.o] Error 1

Can you please advice me how can I fix this issue?