1 CREATE TABLE test1 (x int, y int[]);
2 INSERT INTO test1 VALUES (1, ARRAY[11, 111]);
3 CREATE INDEX test1_y_idx ON test1 USING gin (y) WITH (fastupdate = off);
5 SELECT * FROM gin_metapage_info(get_raw_page('test1_y_idx', 0));
6 -[ RECORD 1 ]----+-----------
7 pending_head | 4294967295
8 pending_tail | 4294967295
18 SELECT * FROM gin_metapage_info(get_raw_page('test1_y_idx', 1));
19 ERROR: input page is not a GIN metapage
20 DETAIL: Flags 0002, expected 0008
21 SELECT * FROM gin_page_opaque_info(get_raw_page('test1_y_idx', 1));
22 -[ RECORD 1 ]---------
23 rightlink | 4294967295
27 SELECT * FROM gin_leafpage_items(get_raw_page('test1_y_idx', 1));
28 ERROR: input page is not a compressed GIN data leaf page
29 DETAIL: Flags 0002, expected 0083
30 INSERT INTO test1 SELECT x, ARRAY[1,10] FROM generate_series(2,10000) x;
32 FROM gin_leafpage_items(get_raw_page('test1_y_idx',
33 (pg_relation_size('test1_y_idx') /
34 current_setting('block_size')::bigint)::int - 1));
38 -- Failure with various modes.
39 -- Suppress the DETAIL message, to allow the tests to work across various
40 -- page sizes and architectures.
43 SELECT gin_leafpage_items('aaa'::bytea);
44 ERROR: invalid page size
45 SELECT gin_metapage_info('bbb'::bytea);
46 ERROR: invalid page size
47 SELECT gin_page_opaque_info('ccc'::bytea);
48 ERROR: invalid page size
49 -- invalid special area size
50 SELECT * FROM gin_metapage_info(get_raw_page('test1', 0));
51 ERROR: input page is not a valid GIN metapage
52 SELECT * FROM gin_page_opaque_info(get_raw_page('test1', 0));
53 ERROR: input page is not a valid GIN data leaf page
54 SELECT * FROM gin_leafpage_items(get_raw_page('test1', 0));
55 ERROR: input page is not a valid GIN data leaf page
56 \set VERBOSITY default
57 -- Tests with all-zero pages.
59 SELECT gin_leafpage_items(decode(repeat('00', :block_size), 'hex'));
63 SELECT gin_metapage_info(decode(repeat('00', :block_size), 'hex'));
67 SELECT gin_page_opaque_info(decode(repeat('00', :block_size), 'hex'));
68 -[ RECORD 1 ]--------+-
69 gin_page_opaque_info |