Bug 210289

Summary: databases/postgresql95-contrib: Can't load pg_stat_statements, undefined symbol "durable_rename"
Product: Ports & Packages Reporter: robert.ayrapetyan
Component: Individual Port(s)Assignee: pgsql
Status: In Progress ---    
Severity: Affects Only Me CC: girgen, w.schwarzenfeld
Priority: --- Keywords: needs-qa
Version: LatestFlags: bugzilla: maintainer-feedback? (pgsql)
Hardware: Any   
OS: Any   

Description robert.ayrapetyan 2016-06-15 00:18:43 UTC
1. Installed postgresql95-contrib (pkg install postgresql95-contrib)

2. Added to postgresql.conf:

shared_preload_libraries = 'pg_stat_statements'
track_activity_query_size = 2048

3. Server throws:

FATAL:  could not load library "/usr/local/lib/postgresql/pg_stat_statements.so": dlopen (/usr/local/lib/postgresql/pg_stat_statements.so) failed: /usr/local/lib/postgresql/pg_stat_statements.so: Undefined symbol "durable_rename"
pg_ctl: could not start server
Examine the log output.
Comment 1 Palle Girgensohn freebsd_committer 2016-06-16 15:28:15 UTC
There seems to be a bug in postgresql-contrib, it does not depend on the server...

You do not write explicitally that you install postgreaql95-server. Did you? Which version do have?
What does

  pkg info -Ix postgres

Comment 2 Palle Girgensohn freebsd_committer 2016-06-16 15:29:39 UTC
(In reply to Palle Girgensohn from comment #1)

Either way, I cannot reproduce, it's works for me when building from ports.
Comment 3 robert.ayrapetyan 2016-06-16 15:43:08 UTC
Sorry, it was:

postgresql95-client-9.5.1      PostgreSQL database (client)
postgresql95-contrib-9.5.3     The contrib utilities from the PostgreSQL distribution
postgresql95-server-9.5.1      The most advanced open-source database available anywhere

I didn't expected "postgresql95-contrib-9.5.3" to be able to install with the wrong server version (9.5.1), from what I remember with postgresql-client - it will automatically upgrade\downgrade server part.

It works fine after pkg upgrade.
But still think some versioning validation bug exists on packages\ports level.
Comment 4 robert.ayrapetyan 2016-06-16 15:52:46 UTC
And even after that it doesn't work (no errors thrown anywhere though):

2016-06-16 08:50:18.436 PDT,"xxx","yyy",7795,"",5762caba.1e73,1,"",2016-06-16 08:50:18 PDT,4/6,0,ERROR,42883,"function pg_stat_statements_reset() does not exist",,"No function matches the given name and argument types. You might need to add explicit type casts.",,,,"SELECT pg_stat_statements_reset()",8,,""
Comment 5 robert.ayrapetyan 2016-06-16 16:01:16 UTC
"shared_preload_libraries";"pg_stat_statements";"Lists shared libraries to preload into server."
Comment 6 robert.ayrapetyan 2016-06-16 16:26:38 UTC
CREATE EXTENSION pg_stat_statements;

resolved all issues.

The module is really awesome, thanks!

Just to summarize all above - I think postgresql95-contrib should perform a server version validation before installing, this is a minor issue and you can ignore it and close the ticket.

Thanks again!
Comment 7 Walter Schwarzenfeld freebsd_triage 2018-01-14 01:24:03 UTC
If I understand right, this is solved. If it is so, please close the PR.
Comment 8 Palle Girgensohn freebsd_committer 2018-01-14 11:00:00 UTC
Hi, Sorry that this has been lying for more than a year. It is a great idea. I'll take it in at the next update of the port. Thanks!
Comment 9 Palle Girgensohn freebsd_committer 2018-01-14 11:00:50 UTC
re-opening and set as in progress