On Thu, 03 Sep 2026 at 20:11, "cca5507" <[email protected]> wrote:
> Hi,
>
> Non-superusers may use LOAD only for libraries located in
> $libdir/plugins, but currently they must specify that directory
> explicitly, for example:
>
>     LOAD '$libdir/plugins/mylib';
>

According to the documentation [1], this is expected behavior.

        Non-superusers can only apply LOAD to library files located in 
$libdir/plugins/ —
        the specified filename must begin with exactly that string. 

> This differs from local_preload_libraries, which accepts a bare library
> name and automatically prepends $libdir/plugins.
>
> The attached patch moves this expansion from load_libraries() into
> load_file().  As a result, a non-superuser can write:
>
>     LOAD 'mylib';
>
> and have it interpreted as:
>
>     LOAD '$libdir/plugins/mylib';
>
> Thoughts?
>
> --
> Regards,
> ChangAo Chen

[1] https://www.postgresql.org/docs/current/sql-load.html

-- 
Regards,
Japin Li
ChengDu WenWu Information Technology Co., Ltd.


Reply via email to