Fix pg_dump bug in the database-level collation patch. "datcollate" and
[PostgreSQL.git] / src / test / regress / sql / hash_index.sql
blobb0811b7dc0a817be9dd7799bfca3476931fdbd0f
1 --
2 -- HASH_INDEX
3 -- grep 843938989 hash.data
4 --
6 SELECT * FROM hash_i4_heap
7    WHERE hash_i4_heap.random = 843938989;
9 --
10 -- hash index
11 -- grep 66766766 hash.data
13 SELECT * FROM hash_i4_heap
14    WHERE hash_i4_heap.random = 66766766;
17 -- hash index
18 -- grep 1505703298 hash.data
20 SELECT * FROM hash_name_heap
21    WHERE hash_name_heap.random = '1505703298'::name;
24 -- hash index
25 -- grep 7777777 hash.data
27 SELECT * FROM hash_name_heap
28    WHERE hash_name_heap.random = '7777777'::name;
31 -- hash index
32 -- grep 1351610853 hash.data
34 SELECT * FROM hash_txt_heap
35    WHERE hash_txt_heap.random = '1351610853'::text;
38 -- hash index
39 -- grep 111111112222222233333333 hash.data
41 SELECT * FROM hash_txt_heap
42    WHERE hash_txt_heap.random = '111111112222222233333333'::text;
45 -- hash index
46 -- grep 444705537 hash.data
48 SELECT * FROM hash_f8_heap
49    WHERE hash_f8_heap.random = '444705537'::float8;
52 -- hash index
53 -- grep 88888888 hash.data
55 SELECT * FROM hash_f8_heap
56    WHERE hash_f8_heap.random = '88888888'::float8;
59 -- hash index
60 -- grep '^90[^0-9]' hashovfl.data
62 -- SELECT count(*) AS i988 FROM hash_ovfl_heap
63 --    WHERE x = 90;
66 -- hash index
67 -- grep '^1000[^0-9]' hashovfl.data
69 -- SELECT count(*) AS i0 FROM hash_ovfl_heap
70 --    WHERE x = 1000;
73 -- HASH
75 UPDATE hash_i4_heap
76    SET random = 1
77    WHERE hash_i4_heap.seqno = 1492;
79 SELECT h.seqno AS i1492, h.random AS i1
80    FROM hash_i4_heap h
81    WHERE h.random = 1;
83 UPDATE hash_i4_heap 
84    SET seqno = 20000 
85    WHERE hash_i4_heap.random = 1492795354;
87 SELECT h.seqno AS i20000 
88    FROM hash_i4_heap h
89    WHERE h.random = 1492795354;
91 UPDATE hash_name_heap 
92    SET random = '0123456789abcdef'::name
93    WHERE hash_name_heap.seqno = 6543;
95 SELECT h.seqno AS i6543, h.random AS c0_to_f
96    FROM hash_name_heap h
97    WHERE h.random = '0123456789abcdef'::name;
99 UPDATE hash_name_heap
100    SET seqno = 20000
101    WHERE hash_name_heap.random = '76652222'::name;
104 -- this is the row we just replaced; index scan should return zero rows 
106 SELECT h.seqno AS emptyset
107    FROM hash_name_heap h
108    WHERE h.random = '76652222'::name;
110 UPDATE hash_txt_heap 
111    SET random = '0123456789abcdefghijklmnop'::text
112    WHERE hash_txt_heap.seqno = 4002;
114 SELECT h.seqno AS i4002, h.random AS c0_to_p
115    FROM hash_txt_heap h
116    WHERE h.random = '0123456789abcdefghijklmnop'::text;
118 UPDATE hash_txt_heap
119    SET seqno = 20000
120    WHERE hash_txt_heap.random = '959363399'::text;
122 SELECT h.seqno AS t20000
123    FROM hash_txt_heap h
124    WHERE h.random = '959363399'::text;
126 UPDATE hash_f8_heap
127    SET random = '-1234.1234'::float8
128    WHERE hash_f8_heap.seqno = 8906;
130 SELECT h.seqno AS i8096, h.random AS f1234_1234 
131    FROM hash_f8_heap h
132    WHERE h.random = '-1234.1234'::float8;
134 UPDATE hash_f8_heap 
135    SET seqno = 20000
136    WHERE hash_f8_heap.random = '488912369'::float8;
138 SELECT h.seqno AS f20000
139    FROM hash_f8_heap h
140    WHERE h.random = '488912369'::float8;
142 -- UPDATE hash_ovfl_heap
143 --    SET x = 1000
144 --   WHERE x = 90;
146 -- this vacuums the index as well
147 -- VACUUM hash_ovfl_heap;
149 -- SELECT count(*) AS i0 FROM hash_ovfl_heap
150 --   WHERE x = 90;
152 -- SELECT count(*) AS i988 FROM hash_ovfl_heap
153 --  WHERE x = 1000;