2 psql:hstore.sql:8: NOTICE: type "hstore" is not yet defined
3 DETAIL: Creating a shell type definition.
4 psql:hstore.sql:13: NOTICE: argument type hstore is only a shell
5 psql:hstore.sql:132: NOTICE: type "ghstore" is not yet defined
6 DETAIL: Creating a shell type definition.
7 psql:hstore.sql:137: NOTICE: argument type ghstore is only a shell
15 select 'a=>b'::hstore;
21 select ' a=>b'::hstore;
27 select 'a =>b'::hstore;
33 select 'a=>b '::hstore;
39 select 'a=> b'::hstore;
45 select '"a"=>"b"'::hstore;
51 select ' "a"=>"b"'::hstore;
57 select '"a" =>"b"'::hstore;
63 select '"a"=>"b" '::hstore;
69 select '"a"=> "b"'::hstore;
75 select 'aa=>bb'::hstore;
81 select ' aa=>bb'::hstore;
87 select 'aa =>bb'::hstore;
93 select 'aa=>bb '::hstore;
99 select 'aa=> bb'::hstore;
105 select '"aa"=>"bb"'::hstore;
111 select ' "aa"=>"bb"'::hstore;
117 select '"aa" =>"bb"'::hstore;
123 select '"aa"=>"bb" '::hstore;
129 select '"aa"=> "bb"'::hstore;
135 select 'aa=>bb, cc=>dd'::hstore;
137 ------------------------
138 "aa"=>"bb", "cc"=>"dd"
141 select 'aa=>bb , cc=>dd'::hstore;
143 ------------------------
144 "aa"=>"bb", "cc"=>"dd"
147 select 'aa=>bb ,cc=>dd'::hstore;
149 ------------------------
150 "aa"=>"bb", "cc"=>"dd"
153 select 'aa=>bb, "cc"=>dd'::hstore;
155 ------------------------
156 "aa"=>"bb", "cc"=>"dd"
159 select 'aa=>bb , "cc"=>dd'::hstore;
161 ------------------------
162 "aa"=>"bb", "cc"=>"dd"
165 select 'aa=>bb ,"cc"=>dd'::hstore;
167 ------------------------
168 "aa"=>"bb", "cc"=>"dd"
171 select 'aa=>"bb", cc=>dd'::hstore;
173 ------------------------
174 "aa"=>"bb", "cc"=>"dd"
177 select 'aa=>"bb" , cc=>dd'::hstore;
179 ------------------------
180 "aa"=>"bb", "cc"=>"dd"
183 select 'aa=>"bb" ,cc=>dd'::hstore;
185 ------------------------
186 "aa"=>"bb", "cc"=>"dd"
189 select 'aa=>null'::hstore;
195 select 'aa=>NuLl'::hstore;
201 select 'aa=>"NuLl"'::hstore;
207 select '\\=a=>q=w'::hstore;
213 select '"=a"=>q\\=w'::hstore;
219 select '"\\"a"=>q>w'::hstore;
225 select '\\"a=>q"w'::hstore;
244 select 'aa=>b, c=>d , b=>16'::hstore->'c';
250 select 'aa=>b, c=>d , b=>16'::hstore->'b';
256 select 'aa=>b, c=>d , b=>16'::hstore->'aa';
262 select ('aa=>b, c=>d , b=>16'::hstore->'gg') is null;
268 select ('aa=>NULL, c=>d , b=>16'::hstore->'aa') is null;
275 select isexists('a=>NULL, b=>qq', 'a');
281 select isexists('a=>NULL, b=>qq', 'b');
287 select isexists('a=>NULL, b=>qq', 'c');
293 select isdefined('a=>NULL, b=>qq', 'a');
299 select isdefined('a=>NULL, b=>qq', 'b');
305 select isdefined('a=>NULL, b=>qq', 'c');
312 select delete('a=>1 , b=>2, c=>3'::hstore, 'a');
318 select delete('a=>null , b=>2, c=>3'::hstore, 'a');
324 select delete('a=>1 , b=>2, c=>3'::hstore, 'b');
330 select delete('a=>1 , b=>2, c=>3'::hstore, 'c');
336 select delete('a=>1 , b=>2, c=>3'::hstore, 'd');
338 ------------------------------
339 "a"=>"1", "b"=>"2", "c"=>"3"
343 select 'aa=>1 , b=>2, cq=>3'::hstore || 'cq=>l, b=>g, fg=>f';
345 -------------------------------------------
346 "b"=>"g", "aa"=>"1", "cq"=>"l", "fg"=>"f"
349 select 'aa=>1 , b=>2, cq=>3'::hstore || 'aq=>l';
351 -------------------------------------------
352 "b"=>"2", "aa"=>"1", "aq"=>"l", "cq"=>"3"
355 select 'aa=>1 , b=>2, cq=>3'::hstore || 'aa=>l';
357 --------------------------------
358 "b"=>"2", "aa"=>"l", "cq"=>"3"
361 select 'aa=>1 , b=>2, cq=>3'::hstore || '';
363 --------------------------------
364 "b"=>"2", "aa"=>"1", "cq"=>"3"
367 select ''::hstore || 'cq=>l, b=>g, fg=>f';
369 --------------------------------
370 "b"=>"g", "cq"=>"l", "fg"=>"f"
374 select 'a=>g, b=>c'::hstore || ( 'asd'=>'gf' );
376 ---------------------------------
377 "a"=>"g", "b"=>"c", "asd"=>"gf"
380 select 'a=>g, b=>c'::hstore || ( 'b'=>'gf' );
382 ---------------------
387 select akeys('aa=>1 , b=>2, cq=>3'::hstore || 'cq=>l, b=>g, fg=>f');
393 select akeys('""=>1');
405 select avals('aa=>1 , b=>2, cq=>3'::hstore || 'cq=>l, b=>g, fg=>f');
411 select avals('aa=>1 , b=>2, cq=>3'::hstore || 'cq=>l, b=>g, fg=>NULL');
417 select avals('""=>1');
429 select * from skeys('aa=>1 , b=>2, cq=>3'::hstore || 'cq=>l, b=>g, fg=>f');
438 select * from skeys('""=>1');
444 select * from skeys('');
449 select * from svals('aa=>1 , b=>2, cq=>3'::hstore || 'cq=>l, b=>g, fg=>f');
458 select *, svals is null from svals('aa=>1 , b=>2, cq=>3'::hstore || 'cq=>l, b=>g, fg=>NULL');
467 select * from svals('""=>1');
473 select * from svals('');
478 select * from each('aaa=>bq, b=>NULL, ""=>1 ');
487 select 'a=>b, b=>1, c=>NULL'::hstore @ 'a=>NULL';
493 select 'a=>b, b=>1, c=>NULL'::hstore @ 'a=>NULL, c=>NULL';
499 select 'a=>b, b=>1, c=>NULL'::hstore @ 'a=>NULL, g=>NULL';
505 select 'a=>b, b=>1, c=>NULL'::hstore @ 'g=>NULL';
511 select 'a=>b, b=>1, c=>NULL'::hstore @ 'a=>c';
517 select 'a=>b, b=>1, c=>NULL'::hstore @ 'a=>b';
523 select 'a=>b, b=>1, c=>NULL'::hstore @ 'a=>b, c=>NULL';
529 select 'a=>b, b=>1, c=>NULL'::hstore @ 'a=>b, c=>q';
535 CREATE TABLE testhstore (h hstore);
536 \copy testhstore from 'data/hstore.data'
537 select count(*) from testhstore where h @ 'wait=>NULL';
543 select count(*) from testhstore where h @ 'wait=>CC';
549 select count(*) from testhstore where h @ 'wait=>CC, public=>t';
555 create index hidx on testhstore using gist(h);
556 set enable_seqscan=off;
557 select count(*) from testhstore where h @ 'wait=>NULL';
563 select count(*) from testhstore where h @ 'wait=>CC';
569 select count(*) from testhstore where h @ 'wait=>CC, public=>t';
575 select count(*) from (select (each(h)).key from testhstore) as wow ;
581 select key, count(*) from (select (each(h)).key from testhstore) as wow group by key order by count desc, key;