Re: psql remote shell command
От | David G. Johnston |
---|---|
Тема | Re: psql remote shell command |
Дата | |
Msg-id | CAKFQuwYg6OggMTwRc-dgJurSY-4hG1ZEAnU2V70xg9tDa4ycXQ@mail.gmail.com обсуждение исходный текст |
Ответ на | Re: psql remote shell command (Stephen Frost <sfrost@snowman.net>) |
Список | pgsql-general |
* Dennis (dennisr@visi.com) wrote:
> Is it possible to execute command in on system the is hosting postgresql remotely using psql or other mechanism? I know I can use \! in psql but that executes the commands on the host where I am running psql from. Also, is it possible for a postgres login/user to stop or restart a running postgres instance from in side psql or similar client. e.g. psql -c “pg_ctl stop -D some_data_dir”
You can use COPY with PROGRAM, assuming you're a superuser.
COPY (select 1) TO PROGRAM 'whatever command';
That's thinking outside the box.
Took me a while to find the documentation of the superuser limitation buried in the notes.
I see why SELinux and its ilk are necessary evils in situations where finer grained control is needed.
David J.
В списке pgsql-general по дате отправления: