From: | Matheus Alcantara <matheusssilv97(at)gmail(dot)com> |
---|---|
To: | evsi(at)amazon(dot)com, pgsql-bugs(at)lists(dot)postgresql(dot)org |
Subject: | Re: BUG #18920: LOAD '$libdir/plugins' no longer works in 18beta1 |
Date: | 2025-06-02 14:05:12 |
Message-ID: | CAFY6G8eGLJmdCCLP=MT9k=URegR6oG6Y1doOJXg65Efnzpz9cg@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-bugs |
Hi,
Thanks for reporting this!
On 08/05/25 16:55, PG Bug reporting form wrote:
> Hi,
> The 18beta1 documentation for the LOAD command has remained the same since
> previous major versions.
> https://www.postgresql.org/docs/18/sql-load.html
> In the postgres installation, I can copy something e.g. auto_explain into a
> plugins subdirectory of `pg_config --pkglibdir`
> ```
> cp $(pg_config --pkglibdir)/auto_explain.so $(pg_config
> --pkglibdir)/plugins/auto_explain.so
> ```
> then from the server start:
> ```
> psql (18beta1)
> Type "help" for help.
> postgres=# LOAD '$libdir/plugins/auto_explain.so';
> ERROR: could not access file "plugins/auto_explain.so": No such file or
> directory
> postgres=# \q
> ```
> This behavior differs from documentation and previous majors. It seems to me
> that $libdir is getting stripped out from this commit:
> https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=4f7f7b0
>
The problem is how we are sripping the $libdir from module_pathname. I
think that we should still strip the $libdir from module_pathname when
expanding from a .control file, but we should not expand via LOAD
command, since the user may explicitly specify the $libdir prefix as it
is the case here.
Having this logic on expand_dynamic_library_name() force us to srip the
$libdir for all scenarios, so I think that a better place to have this
is on load_external_function() that is called when executing a SQL
script from an extension. Another approach would be to change the
signature of expand_dynamic_library_name() to receive a boolean and only
srip the $libdir if it's true, but I think that the expand function
should not handle the strip logic, it should only expand the dynamic
library path and nothing else.
I'm also attaching a second patch that has a TAP test case that
reproduce this issue, it has some hacks to move dynamic library files
around to exercice the problem so I'm not sure if it could be good to
also include these tests on the final patch.
--
Matheus Alcantara
Attachment | Content-Type | Size |
---|---|---|
v1-0001-Don-t-strip-libdir-from-LOAD-command.patch | application/octet-stream | 2.1 KB |
v1-0002-Add-TAP-tests-for-striping-libdir.patch | application/octet-stream | 5.5 KB |
From | Date | Subject | |
---|---|---|---|
Next Message | Badia, Antonio | 2025-06-02 14:41:34 | function 'IS JSON ARRAY' not identified |
Previous Message | Dilip Kumar | 2025-06-02 13:12:08 | Re: BUG #18945: Standby synchronization problem |