0

私はpostgresqlにかなり慣れていないので、次のクエリが何をするのか理解できないので、これを説明できるコミュニティメンバーの助けが必要です.

DO $$
DECLARE
    jid integer;
    scid integer;
BEGIN
-- Creating a new job
INSERT INTO pgagent.pga_job(
    jobjclid, jobname, jobdesc, jobhostagent, jobenabled
) VALUES (
    1::integer, 'backup'::text, ''::text, ''::text, true
) RETURNING jobid INTO jid;

-- Steps
-- Inserting a step (jobid: NULL)
INSERT INTO pgagent.pga_jobstep (
    jstjobid, jstname, jstenabled, jstkind,
    jstconnstr, jstdbname, jstonerror,
    jstcode, jstdesc
) VALUES (
    jid, 'backup'::text, true, 'b'::character(1),
    ''::text, ''::name, 'f'::character(1),
    'set PGPASSWORD=password
pg_dump -h "localhost" -U "postgres" -f "D:\backup\backuppg_%date:~-4%_%date:~3,2%_%date:~0,2%__%time:~0,2%_%time:~3,2%_%time:~6,2%" "postgres"'::text, ''::text
) ;
4

1 に答える 1