Fwd: Advice about preloaded libraries

From: Esteban Zimanyi <estebanzimanyi(at)gmail(dot)com>
To: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Fwd: Advice about preloaded libraries
Date: 2023-10-10 08:58:57
Message-ID: CAPqRbE7m3+tDCg08e-5xLXW0aUvaadNvfvXMmupS2_jr_jLCFQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

MobilityDB
https://github.com/MobilityDB/MobilityDB
is a PostgreSQL extension that depends on PosGIS.

Bradford Boyle who has been working on packaging MobilityDB
https://www.postgresql.org/message-id/CAPqRbE716D3gpD0JDbaFAb72ELaJrPpG1LUZvobELNBgL3R0+g@mail.gmail.com
highlighted the issue of which of the GUC shared_preload_libraries vs
local_preload_libraries vs session_preload_libraries should be used to load
the postgis-3 library.

Our understanding of the information in the manual
https://www.postgresql.org/docs/16/runtime-config-client.html#GUC-SESSION-PRELOAD-LIBRARIES
does not give us a clear-cut answer for this question. We are looking for
advice on which of the three options mentioned above should be used.

MobilityDB requires loading PostGIS before any MobilityDB query can be
issued. For example, commenting out the following line
#shared_preload_libraries = 'postgis-3'
in the postgresql.conf shows the following

$ psql test
psql (15.3)
Type "help" for help.

test=# select tgeompoint 'Point(1 1)@2000-01-01';
2023-10-03 16:41:25.980 CEST [8683] ERROR: could not load library
"/usr/local/pgsql/15/lib/libMobilityDB-1.1.so": /usr/local/pgsql/15/lib/
libMobilityDB-1.1.so: undefined symbol: ST_Intersects at character 19
2023-10-03 16:41:25.980 CEST [8683] STATEMENT: select tgeompoint 'Point(1
1)@2000-01-01';
ERROR: could not load library "/usr/local/pgsql/15/lib/libMobilityDB-1.1.so":
/usr/local/pgsql/15/lib/libMobilityDB-1.1.so: undefined symbol:
ST_Intersects
LINE 1: select tgeompoint 'Point(1 1)@2000-01-01';
^
test=# select st_point(1,1);
st_point
--------------------------------------------
0101000000000000000000F03F000000000000F03F
(1 row)

test=# select tgeompoint 'Point(1 1)@2000-01-01';
tgeompoint
-------------------------------------------------------------------
0101000000000000000000F03F000000000000F03F(at)2000-01-01 00:00:00+01
(1 row)

test=#
------------------------------------------------------------

As can be seen above, it is not REALLY mandatory to have
shared_preload_libraries = 'postgis-3' but then the user is responsible for
issuing a query to load PostGIS (select st_point(1,1); above) and then she
is able to execute MobilityDB queries.

Thanks for your advice.

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message David Rowley 2023-10-10 09:10:12 Re: Check each of base restriction clauses for constant-FALSE-or-NULL
Previous Message David Rowley 2023-10-10 08:48:51 Re: Use virtual tuple slot for Unique node