Re: psql remote shell command

Поиск
Список
Период
Сортировка
От Michael Paquier
Тема Re: psql remote shell command
Дата
Msg-id CAB7nPqTKK5fOBuoBKFLdo9YhnauL+eYXiSFaWaV_sO0zaUi1tw@mail.gmail.com
обсуждение исходный текст
Ответ на psql remote shell command  (Dennis <dennisr@visi.com>)
Ответы Re: psql remote shell command  ("David G. Johnston" <david.g.johnston@gmail.com>)
Список pgsql-general
On Fri, Jun 3, 2016 at 8:30 AM, 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”

Not directly. You could implement an extension that wraps a function
available at SQL level taking some actions, however for the restart
the error handling is tricky if you just have control via psql. How
could you start a node that has been stopped during a restart but
could not boot up. Take the example of an incorrect parameter value
that has been added when the node was up via ALTER SYSTEM...
--
Michael


В списке pgsql-general по дате отправления:

Предыдущее
От: Dennis
Дата:
Сообщение: psql remote shell command
Следующее
От: "David G. Johnston"
Дата:
Сообщение: Re: psql remote shell command