Re: Initiate backup from routine?

Поиск
Список
Период
Сортировка
От Pyrote
Тема Re: Initiate backup from routine?
Дата
Msg-id cc0488b7ba69bcebd75391cb1615c11b@guungle.com
обсуждение исходный текст
Ответ на Initiate backup from routine?  (Troels Arvin <troels@arvin.dk>)
Список pgsql-general
On Wednesday, January 17, 2024, Troels Arvin <troels@arvin.dk> 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
Дата:
Сообщение: Re: pg_basebackup Restore problem
Следующее
От: Ron Johnson
Дата:
Сообщение: Re: Initiate backup from routine?