-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
install profiler gives an error #15
Comments
On 12/17/22 06:49, slavadba wrote:
Hi,
***@***.***:~/plprofiler$ pwd /var/lib/postgresql/plprofiler
***@***.***:~/plprofiler$ ***@***.***:~/plprofiler$ sudo
USE_PGXS=1 make install gcc -Wall -Wmissing-prototypes -Wpointer-arith
-Wdeclaration-after-statement -Werror=vla -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 -I. -I./
-I/usr/include/postgresql/12/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 plprofiler.o plprofiler.c
plprofiler.c:20:10: fatal error: postgres.h: No such file or directory
20 | #include "postgres.h" | ^~~~~~~~~~~~ compilation terminated. make:
*** [<builtin>: plprofiler.o] Error 1 ***@***.***:~/plprofiler$ |
Did you install the -dev or -devel packages (depending on your Linux
Distribution), which are supposed to contain the necessary server header
files?
If install from contrib directory I got another error:
***@***.***:/usr/share/postgresql/12/contrib/plprofiler$ make
install Makefile:27: /contrib/contrib-global.mk: No such file or
directory make: *** No rule to make target '/contrib/contrib-global.mk'.
Stop. ***@***.***:/usr/share/postgresql/12/contrib/plprofiler$ |
Just cloning the PostgreSQL repository or unpacking the tarball isn't
enough. You need to run ./configure. I usually do something like
eval ./configure $(pg_config --configure)
to get a source tree that is configured exactly as the currently
installed binaries.
Best Regards, Jan
|
The PL/pgSQL profiler is also available as binary packages (.rpm and
.deb) in the PGDG repositories. It might be easier for you to just
install binaries from there.
Best Regards, Jan
…On 12/18/22 15:33, Jan Wieck wrote:
On 12/17/22 06:49, slavadba wrote:
> Hi,
>
> ***@***.***:~/plprofiler$ pwd /var/lib/postgresql/plprofiler
> ***@***.***:~/plprofiler$ ***@***.***:~/plprofiler$ sudo
> USE_PGXS=1 make install gcc -Wall -Wmissing-prototypes -Wpointer-arith
> -Wdeclaration-after-statement -Werror=vla -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 -I. -I./
> -I/usr/include/postgresql/12/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 plprofiler.o plprofiler.c
> plprofiler.c:20:10: fatal error: postgres.h: No such file or directory
> 20 | #include "postgres.h" | ^~~~~~~~~~~~ compilation terminated. make:
> *** [<builtin>: plprofiler.o] Error 1 ***@***.***:~/plprofiler$ |
Did you install the -dev or -devel packages (depending on your Linux
Distribution), which are supposed to contain the necessary server header
files?
>
> If install from contrib directory I got another error:
>
> ***@***.***:/usr/share/postgresql/12/contrib/plprofiler$ make
> install Makefile:27: /contrib/contrib-global.mk: No such file or
> directory make: *** No rule to make target '/contrib/contrib-global.mk'.
> Stop. ***@***.***:/usr/share/postgresql/12/contrib/plprofiler$ |
Just cloning the PostgreSQL repository or unpacking the tarball isn't
enough. You need to run ./configure. I usually do something like
eval ./configure $(pg_config --configure)
to get a source tree that is configured exactly as the currently
installed binaries.
Best Regards, Jan
|
Installation from binary packages solve all problems. |
one more question is off topic , but in order not to create a new issue, I 'll ask here if you don 't mind:
|
On 12/19/22 05:00, slavadba wrote:
one more question is off topic , but in order not to create a new issue,
I 'll ask here if you don 't mind:
|postgres=# SELECT pl_profiler_enable(true); ERROR: function
pl_profiler_enable(boolean) does not exist LINE 1: SELECT
pl_profiler_enable(true); ^ HINT: No function matches the given name and
There are two functions, pl_profiler_set_enabled_local(bool) and
pl_profiler_set_enabled_global(bool). The global one only works if
plprofiler was loaded via shared_preload_libraries.
… argument types. You might need to add explicit type casts. postgres=#
postgres=# select * from pg_extension ; oid | extname | extowner |
extnamespace | extrelocatable | extversion | extconfig | extcondition
-------+--------------------+----------+--------------+----------------+------------+-----------+-------------- 13449 | plpgsql | 10 | 11 | f | 1.0 | | 24617 | plpgsql_check | 10 | 2200 | f | 1.14 | | 32812 | pg_stat_statements | 10 | 2200 | t | 1.7 | | 32820 | plprofiler | 10 | 2200 | t | 4.2 | | (4 rows) postgres=# select count(*) from pg_proc where proname='pl_profiler_enable'; count ------- 0 (1 row) postgres= ```# |
—
Reply to this email directly, view it on GitHub
<#15 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AACYRMUGT4GRTKPEVMGLIQ3WOAW2TANCNFSM6AAAAAATB46SVY>.
You are receiving this because you commented.Message ID:
***@***.***>
|
there is no mention in the examples https://github.com/bigsql/plprofiler/blob/master/doc/examples.md about pl_profiler_set_enabled_local - it says about pl_profiler_enable, therefore, it probably needs to be corrected. |
Hi,
If install from contrib directory I got another error:
I cant find contrib-global.mk - so maybe its wrong contrib??
but in any case, this does not explain the error in the first case when the installation does not come from the contrib.
Postgres version :
The text was updated successfully, but these errors were encountered: