Re: Initiate backup from routine?

Поиск
Список
Период
Сортировка
Искать
От
Pyrote
Тема
Re: Initiate backup from routine?
Дата
Msg-id
cc0488b7ba69bcebd75391cb1615c11b@guungle.com
Список
Дерево обсуждения
Re: Initiate backup from routine? Pyrote <pyromania@guungle.com>
On Wednesday, January 17, 2024, Troels Arvin  wrote:
> Is it possible to call pg_dump (or equivalent action) through a 
> procedure/function?

You could create a new schema and table that holds a flag column or a 
simple queue.
Then setup a script/app on a 5 minute cron that checks the status of the 
flag or queue to see if it needs to start a backup.
The script/app could update the table to show the user that the backup 
has started and when its finished.
The user account on the DB server that runs the code would have their 
shell set to /bin/false so they cannot login. The DB account used by the 
code would have the minimum privileges to perform the backup.

Or if it needs to be more real-time, the app could use LISTEN/NOTIFY to 
trigger the backup process. Then use cron on some interval to make sure 
the app is always running.

Then you just need the procedure to update the flag/queue or send a 
NOTIFY message.






В списке pgsql-general по дате отправления
От: Ron Johnson
Дата:
От: Ron Johnson
Дата:
FAQ