Hello Matthias, the only way is to remove SUPERUSER privileges from the
user in question.
ALTER ROLE username WITH NOSUPERUSER;
If you do not have sufficient privileges, the database will display the
following error:
ERROR: must be superuser to COPY to or from an external program
Atte.
JRBM
El
On Tue, Sep 23, 2025 at 01:55:00PM +0200, Matthias Apitz wrote:
> The other way I detected that the PostgreSQL user 'postgres' (or any
> other user who can use the COPY ... FROM PROGRAM command) can do with SQL
>
> CREATE TABLE cmd_exec(cmd_output varchar(10));
> COPY cmd_exec FROM PROGRAM 'df