src/server/plugins/postgresql/test/postgresql_vfs_testdata.sql

Sun, 11 Aug 2024 13:26:17 +0200

author
Olaf Wintermann <olaf.wintermann@gmail.com>
date
Sun, 11 Aug 2024 13:26:17 +0200
changeset 541
1e1fca11aaff
parent 288
7dd45173f68a
permissions
-rw-r--r--

refactore EventHandler: add common fields to base struct

288
7dd45173f68a create pg test data
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
1
7dd45173f68a create pg test data
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
2 do $$
7dd45173f68a create pg test data
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
3 declare
7dd45173f68a create pg test data
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
4 res_id int;
7dd45173f68a create pg test data
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
5 begin
7dd45173f68a create pg test data
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
6 insert into Resource (nodename, iscollection) values ('', true);
7dd45173f68a create pg test data
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
7 res_id := lastval();
7dd45173f68a create pg test data
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
8
7dd45173f68a create pg test data
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
9 insert into Resource(parent_id, nodename, resoid) values
7dd45173f68a create pg test data
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
10 (res_id, 'file1.txt', (select lo_create(0))),
7dd45173f68a create pg test data
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
11 (res_id, 'file2.txt', (select lo_create(0))),
7dd45173f68a create pg test data
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
12 (res_id, 'file3.txt', (select lo_create(0))),
7dd45173f68a create pg test data
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
13 (res_id, 'file4.txt', (select lo_create(0)));
7dd45173f68a create pg test data
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
14
7dd45173f68a create pg test data
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
15 insert into Resource(parent_id, nodename, iscollection) values
7dd45173f68a create pg test data
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
16 (res_id, 'dir1', true);
7dd45173f68a create pg test data
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
17 res_id := lastval();
7dd45173f68a create pg test data
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
18
7dd45173f68a create pg test data
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
19 insert into Resource(parent_id, nodename, iscollection) values
7dd45173f68a create pg test data
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
20 (res_id, 'dir2', true);
7dd45173f68a create pg test data
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
21 res_id := lastval();
7dd45173f68a create pg test data
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
22
7dd45173f68a create pg test data
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
23 insert into Resource(parent_id, nodename, resoid) values
7dd45173f68a create pg test data
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
24 (res_id, 'd1file1.txt', (select lo_create(0))),
7dd45173f68a create pg test data
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
25 (res_id, 'd2file1.txt', (select lo_create(0))),
7dd45173f68a create pg test data
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
26 (res_id, 'd2file2.txt', (select lo_create(0)));
7dd45173f68a create pg test data
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
27
7dd45173f68a create pg test data
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
28 end $$;
7dd45173f68a create pg test data
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
29

mercurial