doc/development/postgresql_vfs_testdata.sql

Sun, 14 Aug 2022 11:40:54 +0200

author
Olaf Wintermann <olaf.wintermann@gmail.com>
date
Sun, 14 Aug 2022 11:40:54 +0200
branch
webdav
changeset 374
77506ec632a4
parent 283
25e5b771677d
permissions
-rw-r--r--

use configured root node from PgRepository in pg vfs/webdav


do $$
declare
    res_id int;
begin
    insert into Resource (nodename, iscollection) values ('', true);
    res_id := lastval();
   
    insert into Resource(parent_id,  nodename, resoid) values
    (res_id, 'file1.txt', (select lo_create(0))),
    (res_id, 'file2.txt', (select lo_create(0))),
    (res_id, 'file3.txt', (select lo_create(0))),
    (res_id, 'file4.txt', (select lo_create(0)));
    
    insert into Resource(parent_id,  nodename, iscollection) values
    (res_id, 'dir1', true);
    res_id := lastval();
    
    insert into Resource(parent_id,  nodename, iscollection) values
    (res_id, 'dir2', true);
    res_id := lastval();
    
    insert into Resource(parent_id,  nodename, resoid) values
    (res_id, 'd1file1.txt', (select lo_create(0))),
    (res_id, 'd2file1.txt', (select lo_create(0))),
    (res_id, 'd2file2.txt', (select lo_create(0)));

end $$;

mercurial