V
V
Valentine2018-04-22 19:29:36
PHP
Valentine, 2018-04-22 19:29:36

Uploading a file to Postgres storage without superuser permissions in PHP?

Good day!
When I try to use the pg_lo_import function, I get an error:

ERROR: must be superuser to use server-side lo_import()
HINT: Anyone can use the client-side lo_import() provided by libpq.

Uses the standard PostgreSQL extension.
Target OS AstraLinux.
When connecting from an application written in Qt, there are no problems with rights, although the connection is made under the same user.
The manuals say that the php extension uses Libpq. I can't give the user a superrole, he is a normal user.
What could be wrong? How is this problem solved?
Google didn't help

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
alexalexes, 2018-04-22
@alexalexes

If you cannot manage users, then you need to create an application that can connect on behalf of another user with the required set of rights.
Only this application must be running on the server on a permanent basis and be able to exchange via http with PHP via curl.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question