Re: Run procedure at startup

Поиск
Список
Период
Сортировка
От John R Pierce
Тема Re: Run procedure at startup
Дата
Msg-id 4A6DD276.4010609@hogranch.com
обсуждение исходный текст
Ответ на Run procedure at startup  ("Saleem EDAH-TALLY" <nmset@netcourrier.com>)
Список pgsql-general
Saleem EDAH-TALLY wrote:
> Is there a way to run a pl/pgsql automatically at server startup ?

in your postgres startup script launch a session with `psql ... -c "some
sql commands"` or `psql ... -f somescript.sql` ...


> Is there a way to run a pl/pgsql function with an infinite loop as a
> daemon ?

functions are called from within a transaction.   if you did this, that
transaction would never end, and this would prevent VACUUM from cleaning
up any freed tuples from newer than the start of that transaction.   Not
good.   you could, however, have a system daemon that periodically
invokes a plpgsql function.


> Is there a way to start a pl/pgsql function that would persist after
> the user session has closed ?

no.


> Is there a way for an unprivileged user to delegate a task (allowed by
> superuser) to a superuser ?

someone else will have to chime in here.



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

Предыдущее
От: Pavel Stehule
Дата:
Сообщение: Re: Run procedure at startup
Следующее
От: Alexey Klyukin
Дата:
Сообщение: Re: Calculating the difference between timetz values