Repair ALTER EXTENSION ... SET SCHEMA.
[pgsql.git] / src / test / modules / test_slru / sql / test_slru.sql
blobb1b376581ab74d4ee1e7e914793ef671d6d13b6d
1 CREATE EXTENSION test_slru;
3 SELECT test_slru_page_exists(12345);
4 SELECT test_slru_page_write(12345, 'Test SLRU');
5 SELECT test_slru_page_read(12345);
6 SELECT test_slru_page_exists(12345);
8 -- 48 extra pages
9 SELECT count(test_slru_page_write(a, 'Test SLRU'))
10   FROM generate_series(12346, 12393, 1) as a;
12 -- Reading page in buffer for read and write
13 SELECT test_slru_page_read(12377, true);
14 -- Reading page in buffer for read-only
15 SELECT test_slru_page_readonly(12377);
16 -- Reading page not in buffer with read-only
17 SELECT test_slru_page_readonly(12346);
19 -- Write all the pages in buffers
20 SELECT test_slru_page_writeall();
21 -- Flush the last page written out.
22 SELECT test_slru_page_sync(12393);
23 SELECT test_slru_page_exists(12393);
24 -- Segment deletion
25 SELECT test_slru_page_delete(12393);
26 SELECT test_slru_page_exists(12393);
27 -- Page truncation
28 SELECT test_slru_page_exists(12377);
29 SELECT test_slru_page_truncate(12377);
30 SELECT test_slru_page_exists(12377);
32 -- Full deletion
33 SELECT test_slru_delete_all();
34 SELECT test_slru_page_exists(12345);
35 SELECT test_slru_page_exists(12377);
36 SELECT test_slru_page_exists(12393);
39 -- Test 64-bit pages
41 SELECT test_slru_page_exists(0x1234500000000);
42 SELECT test_slru_page_write(0x1234500000000, 'Test SLRU 64-bit');
43 SELECT test_slru_page_read(0x1234500000000);
44 SELECT test_slru_page_exists(0x1234500000000);
46 -- 48 extra pages
47 SELECT count(test_slru_page_write(a, 'Test SLRU 64-bit'))
48   FROM generate_series(0x1234500000001, 0x1234500000030, 1) as a;
50 -- Reading page in buffer for read and write
51 SELECT test_slru_page_read(0x1234500000020, true);
52 -- Reading page in buffer for read-only
53 SELECT test_slru_page_readonly(0x1234500000020);
54 -- Reading page not in buffer with read-only
55 SELECT test_slru_page_readonly(0x1234500000001);
57 -- Write all the pages in buffers
58 SELECT test_slru_page_writeall();
59 -- Flush the last page written out.
60 SELECT test_slru_page_sync(0x1234500000030);
61 SELECT test_slru_page_exists(0x1234500000030);
62 -- Segment deletion
63 SELECT test_slru_page_delete(0x1234500000030);
64 SELECT test_slru_page_exists(0x1234500000030);
65 -- Page truncation
66 SELECT test_slru_page_exists(0x1234500000020);
67 SELECT test_slru_page_truncate(0x1234500000020);
68 SELECT test_slru_page_exists(0x1234500000020);
70 -- Full deletion
71 SELECT test_slru_delete_all();
72 SELECT test_slru_page_exists(0x1234500000000);
73 SELECT test_slru_page_exists(0x1234500000020);
74 SELECT test_slru_page_exists(0x1234500000030);
76 DROP EXTENSION test_slru;