[PATCH] Allow bare library names for non-superuser LOAD

From: cca5507 <cca5507(at)qq(dot)com>
To: pgsql-hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: [PATCH] Allow bare library names for non-superuser LOAD
Date: 2026-09-03 12:11:02
Message-ID: tencent_E6968C151EDE818A1D4CA85FA1772D668A06@qq.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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';

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

Attachment Content-Type Size
v1-0001-Allow-bare-library-names-for-non-superuser-LOAD.patch application/octet-stream 3.8 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Matthias van de Meent 2026-09-03 12:16:09 Re: glist: _Generic wrapper for selective dlist/dclist usage
Previous Message Amit Kapila 2026-09-03 12:07:16 Re: Remove stale XXX comment in logical launcher