Re: Initiate backup from routine?

2024-01-18 Thread Stephen Frost
Greetings, * Ron Johnson (ronljohnso...@gmail.com) wrote: > On Wed, Jan 17, 2024 at 9:41 AM Troels Arvin wrote: > > I would like to allow a co-worker to perform a backup of a database, such > > that the backup is saved to the database server itself. One use case is > > that (s)he would like an

RE: Initiate backup from routine?

2024-01-17 Thread Kamil ADEM
Hello Troels, You can use the following statements in a procedure/function: CREATE TEMPORARY TABLE tt_cmdout(cmdoutput text); COPY tt_cmdout(cmdoutput) FROM PROGRAM 'pg_dump.exe '; But note that the user must have SUPERUSER or BYPASSRLS privileges or must be table owner. Ragards, Kamil Adem

Re: Initiate backup from routine?

2024-01-17 Thread Ron Johnson
On Wed, Jan 17, 2024 at 9:41 AM Troels Arvin wrote: > Hello, > > I would like to allow a co-worker to perform a backup of a database, such > that the backup is saved to the database server itself. One use case is > that (s)he would like an extra backup of a database, just before an > application

Re: Initiate backup from routine?

2024-01-17 Thread Pyrote
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

Re: Initiate backup from routine?

2024-01-17 Thread Troels Arvin
Hello, David wrote: /  Are you able to install an untrusted language handler into the database?/ Yes, if need be. -- Regards, Troels Arvin

Re: Initiate backup from routine?

2024-01-17 Thread David G. Johnston
On Wednesday, January 17, 2024, Troels Arvin wrote: > > Is it possible to call pg_dump (or equivalent action) through a > procedure/function? > Are you able to install an untrusted language handler into the database? They are untrusted because they can basically get shell on the server. David