1 SELECT 'ff => {a=>12, b=>16}'::hstore;
3 --------------------------
4 "ff"=>{"a"=>12, "b"=>16}
7 SELECT 'ff => {a=>12, b=>16}, qq=> 123'::hstore;
9 -------------------------------------
10 "ff"=>{"a"=>12, "b"=>16}, "qq"=>123
13 SELECT 'aa => {a,aaa}, qq=>{ a=>12, b=>16 , c=> { c1, c2}, d=>{d1=>d1, d2=>d2, d1=>d3} }'::hstore;
15 ------------------------------------------------------------------------------------------------
16 "aa"=>["a", "aaa"], "qq"=>{"a"=>12, "b"=>16, "c"=>["c1", "c2"], "d"=>{"d1"=>"d3", "d2"=>"d2"}}
19 SELECT '"aa"=>{a,aaa}, "qq"=>{"a"=>"12", "b"=>"16", "c"=>{c1,c2}, "d"=>{"d1"=>"d1", "d2"=>"d2"}}'::hstore;
21 ----------------------------------------------------------------------------------------------------
22 "aa"=>["a", "aaa"], "qq"=>{"a"=>"12", "b"=>"16", "c"=>["c1", "c2"], "d"=>{"d1"=>"d1", "d2"=>"d2"}}
25 SELECT '"aa"=>{a,aaa}, "qq"=>{"a"=>"12", "b"=>"16", "c"=>{c1,c2,{c3},{c4=>4}}, "d"=>{"d1"=>"d1", "d2"=>"d2"}}'::hstore;
27 -----------------------------------------------------------------------------------------------------------------------
28 "aa"=>["a", "aaa"], "qq"=>{"a"=>"12", "b"=>"16", "c"=>["c1", "c2", ["c3"], {"c4"=>4}], "d"=>{"d1"=>"d1", "d2"=>"d2"}}
31 SELECT 'ff => {a,aaa}'::hstore;
37 select 'null'::hstore;
43 select '{null}'::hstore;
61 --test optional outer braces
62 SELECT 'a=>1'::hstore;
68 SELECT '{a=>1}'::hstore;
74 SELECT '{a,b}'::hstore;
80 SELECT '{a,{b}}'::hstore;
86 SELECT '{{a},b}'::hstore;
92 SELECT '{a,{b},{c}}'::hstore;
98 SELECT '{{a},{b},c}'::hstore;
100 ---------------------
104 SELECT '{{a},b,{c}}'::hstore;
106 ---------------------
110 SELECT '{a,{b=>1}}'::hstore;
116 SELECT '{{a},{b=>1}}'::hstore;
128 SELECT '{a}'::hstore;
147 SELECT hstore_to_json('a=>1');
153 SELECT hstore_to_json('{a=>1}');
159 SELECT hstore_to_json('{a,b}');
165 SELECT hstore_to_json('{a,{b}}');
171 SELECT hstore_to_json('{{a},b}');
177 SELECT hstore_to_json('{a,{b},{c}}');
179 ---------------------
183 SELECT hstore_to_json('{{a},{b},c}');
185 ---------------------
189 SELECT hstore_to_json('{{a},b,{c}}');
191 ---------------------
195 SELECT hstore_to_json('{a,{b=>1}}');
201 SELECT hstore_to_json('{{a},{b=>1}}');
207 SELECT hstore_to_json('{{a},{b=>1},{c}}');
209 --------------------------
210 [["a"], {"b": 1}, ["c"]]
213 SELECT hstore_to_json('a');
219 SELECT hstore_to_json('{a}');
225 SELECT hstore_to_json('');
231 SELECT hstore_to_json('{}');
237 SELECT hstore_to_json('"aa"=>{a,aaa}, "qq"=>{"a"=>"12", "b"=>"16", "c"=>{c1,c2,{c3},{c4=>4}}, "d"=>{"d1"=>"d1", "d2"=>"d2"}}'::hstore);
239 -------------------------------------------------------------------------------------------------------------------------
240 {"aa": ["a", "aaa"], "qq": {"a": "12", "b": "16", "c": ["c1", "c2", ["c3"], {"c4": 4}], "d": {"d1": "d1", "d2": "d2"}}}
244 SELECT 'ff => {a=>12, b=>16}, qq=> 123, x=>{1,2}, Y=>NULL'::hstore -> 'ff',
245 'ff => {a=>12, b=>16}, qq=> 123, x=>{1,2}, Y=>NULL'::hstore -> 'qq',
246 ('ff => {a=>12, b=>16}, qq=> 123, x=>{1,2}, Y=>NULL'::hstore -> 'Y') IS NULL AS t,
247 'ff => {a=>12, b=>16}, qq=> 123, x=>{1,2}, Y=>NULL'::hstore -> 'x';
248 ?column? | ?column? | t | ?column?
249 ------------------+----------+---+----------
250 "a"=>12, "b"=>16 | 123 | t | [1, 2]
253 SELECT '[ a, b, c, d]'::hstore -> 'a';
260 CREATE TABLE testtype (i int, h hstore, a int[], j json);
261 INSERT INTO testtype VALUES (1, 'a=>1', '{1,2,3}', '{"x": 2}');
262 SELECT populate_record(v, 'i=>2'::hstore) FROM testtype v;
264 ---------------------------------------
265 (2,"""a""=>1","{1,2,3}","{""x"": 2}")
268 SELECT populate_record(v, 'i=>2, a=>{7,8,9}'::hstore) FROM testtype v;
270 ---------------------------------------
271 (2,"""a""=>1","{7,8,9}","{""x"": 2}")
274 SELECT populate_record(v, 'i=>2, h=>{b=>3}, a=>{7,8,9}'::hstore) FROM testtype v;
276 ---------------------------------------
277 (2,"""b""=>3","{7,8,9}","{""x"": 2}")
280 SELECT populate_record(v, 'i=>2, h=>{b=>3}, a=>{7,8,9}, j=>{a=>{1,2,3}}'::hstore) FROM testtype v;
282 -----------------------------------------------
283 (2,"""b""=>3","{7,8,9}","{""a"": [1, 2, 3]}")
287 SELECT 'b=>{a,c}'::hstore - 'a'::text;
293 SELECT 'b=>{a,c}, a=>1'::hstore - 'a'::text;
299 SELECT 'b=>{a,c}, a=>[2,3]'::hstore - 'a'::text;
305 SELECT 'b=>{a,c}, a=>[2,3]'::hstore - 'a'::text;
311 SELECT '[2,3,a]'::hstore - 'a'::text;
317 SELECT '[a,2,3,a]'::hstore - 'a'::text;
323 SELECT '[a,a]'::hstore - 'a'::text;
329 SELECT '[a]'::hstore - 'a'::text;
335 SELECT 'a=>1'::hstore - 'a'::text;
341 SELECT ''::hstore - 'a'::text;
347 SELECT '{a, 1 , b,2, c,3}'::hstore - ARRAY['d','b'];
349 ---------------------
353 SELECT '{a=>{1,2}, v=>23, b=>c}'::hstore - 'v'::hstore;
355 -----------------------
356 "a"=>[1, 2], "b"=>"c"
359 SELECT '{a=>{1,2}, v=>23, b=>c}'::hstore - 'v=>23'::hstore;
361 -----------------------
362 "a"=>[1, 2], "b"=>"c"
365 SELECT '{a=>{1,2}, v=>23, b=>c}'::hstore - 'v=>{1,2}'::hstore;
367 --------------------------------
368 "a"=>[1, 2], "b"=>"c", "v"=>23
371 SELECT '{a=>{1,2}, v=>23, b=>c}'::hstore - 'a=>{1,2}'::hstore;
377 SELECT '{a, {1,2}, v, 23, b, c}'::hstore - 'v'::hstore;
379 -----------------------------
380 ["a", [1, 2], 23, "b", "c"]
383 SELECT '{a, {1,2}, v, 23, b, c}'::hstore - 'v=>23'::hstore;
385 -------------------------
386 ["a", [1, 2], "b", "c"]
389 SELECT '{a, {1,2}, v, 23, b, c}'::hstore - '[v,23]'::hstore;
391 -------------------------
392 ["a", [1, 2], "b", "c"]
395 SELECT '{a, {1,2}, v, 23, b, c}'::hstore - '[v,{1,2}]'::hstore;
397 ---------------------
402 SELECT 'aa=>1 , b=>2, cq=>3'::hstore || '{cq,l, b,g, fg,f, 1,2}'::hstore;
404 -----------------------------------------------
405 "1"=>2, "b"=>"g", "aa"=>1, "cq"=>"l", "fg"=>f
408 SELECT '{aa,1 , b,2, cq,3}'::hstore || '{cq,l, b,g, fg,f, 1,2}'::hstore;
410 ----------------------------------------------------------------
411 ["aa", 1, "b", 2, "cq", 3, "cq", "l", "b", "g", "fg", f, 1, 2]
414 SELECT 'x'::hstore || 'a=>"1"':: hstore;
421 SELECT slice_array(hstore 'aa=>1, b=>2, c=>3', ARRAY['g','h','i']);
427 SELECT slice_array(hstore '{aa,1, b,2, c,3}', ARRAY['g','h','i']);
433 SELECT slice_array(hstore 'aa=>1, b=>2, c=>3', ARRAY['b','c']);
439 SELECT slice_array(hstore '{aa,1, b,2, c,3}', ARRAY['b','c']);
445 SELECT slice_array(hstore 'aa=>1, b=>{2=>1}, c=>{1,2}', ARRAY['b','c']);
447 -----------------------
448 {"\"2\"=>1","[1, 2]"}
451 SELECT slice(hstore '{aa=>1, b=>2, c=>3}', ARRAY['g','h','i']);
457 SELECT slice(hstore '{aa,1, b,2, c,3}', ARRAY['g','h','i']);
463 SELECT slice(hstore '{aa=>1, b=>2, c=>3}', ARRAY['b','c']);
469 SELECT slice(hstore '{aa,1, b,2, c,3}', ARRAY['b','c']);
475 SELECT slice(hstore '{aa=>1, b=>{2=>1}, c=>{1,2}}', ARRAY['b','c']);
477 ----------------------------
478 "b"=>{"2"=>1}, "c"=>[1, 2]
482 SELECT %% 'aa=>1, cq=>l, b=>{a,n}, fg=>NULL';
484 ----------------------------------------
485 {b,"[\"a\", \"n\"]",aa,1,cq,l,fg,NULL}
488 SELECT %% '{aa,1, cq,l, b,g, fg,NULL}';
490 -------------------------
491 {aa,1,cq,l,b,g,fg,NULL}
494 SELECT hstore_to_matrix( 'aa=>1, cq=>l, b=>{a,n}, fg=>NULL');
496 ------------------------------------------------
497 {{b,"[\"a\", \"n\"]"},{aa,1},{cq,l},{fg,NULL}}
500 SELECT hstore_to_matrix( '{aa,1, cq,l, b,g, fg,NULL}');
502 ---------------------------------
503 {{aa,1},{cq,l},{b,g},{fg,NULL}}
507 SELECT 'a=>b'::hstore @> 'a=>b, c=>b';
513 SELECT 'a=>b, c=>b'::hstore @> 'a=>b';
519 SELECT 'a=>{1,2}, c=>b'::hstore @> 'a=>{1,2}';
525 SELECT 'a=>{2,1}, c=>b'::hstore @> 'a=>{1,2}';
531 SELECT 'a=>{1=>2}, c=>b'::hstore @> 'a=>{1,2}';
537 SELECT 'a=>{2=>1}, c=>b'::hstore @> 'a=>{1,2}';
543 SELECT 'a=>{1=>2}, c=>b'::hstore @> 'a=>{1=>2}';
549 SELECT 'a=>{2=>1}, c=>b'::hstore @> 'a=>{1=>2}';
555 SELECT '{a,b}'::hstore @> '{a,b, c,b}';
561 SELECT '{a,b, c,b}'::hstore @> '{a,b}';
567 SELECT '{a,b, c,{1,2}}'::hstore @> '{a,{1,2}}';
573 SELECT '{a,b, c,{1,2}}'::hstore @> '{b,{1,2}}';
579 SELECT 'a=>{1,2}, c=>b'::hstore @> 'a=>{1}';
585 SELECT 'a=>{1,2}, c=>b'::hstore @> 'a=>{2}';
591 SELECT 'a=>{1,2}, c=>b'::hstore @> 'a=>{3}';
597 SELECT 'a=>{1,2,{c=>3, x=>4}}, c=>b'::hstore @> 'a=>{{c=>3}}';
603 SELECT 'a=>{1,2,{c=>3, x=>4}}, c=>b'::hstore @> 'a=>{{x=>4}}';
609 SELECT 'a=>{1,2,{c=>3, x=>4}}, c=>b'::hstore @> 'a=>{{x=>4},3}';
615 SELECT 'a=>{1,2,{c=>3, x=>4}}, c=>b'::hstore @> 'a=>{{x=>4},1}';
622 SELECT 'n=>NULL, a=>1, b=>{1,2}, c=>{1=>2}, d=>{1=>{2,3}}'::hstore %> 'n';
628 SELECT 'n=>NULL, a=>1, b=>{1,2}, c=>{1=>2}, d=>{1=>{2,3}}'::hstore %> 'a';
634 SELECT 'n=>NULL, a=>1, b=>{1,2}, c=>{1=>2}, d=>{1=>{2,3}}'::hstore %> 'b';
640 SELECT 'n=>NULL, a=>1, b=>{1,2}, c=>{1=>2}, d=>{1=>{2,3}}'::hstore %> 'c';
646 SELECT 'n=>NULL, a=>1, b=>{1,2}, c=>{1=>2}, d=>{1=>{2,3}}'::hstore %> 'd';
652 SELECT 'n=>NULL, a=>1, b=>{1,2}, c=>{1=>2}, d=>{1=>{2,3}}'::hstore %> 'd' %> '1';
658 SELECT '[1,2,3,{a,b}]'::hstore %> '1';
664 SELECT '["1",2,3,{a,b}]'::hstore %> '1';
670 SELECT 'n=>NULL, a=>1, b=>{1,2}, c=>{1=>2}, d=>{1=>{2,3}}'::hstore %> 5;
676 SELECT 'n=>NULL, a=>1, b=>{1,2}, c=>{1=>2}, d=>{1=>{2,3}}'::hstore %> 4;
682 SELECT 'n=>NULL, a=>1, b=>{1,2}, c=>{1=>2}, d=>{1=>{2,3}}'::hstore %> 3;
688 SELECT 'n=>NULL, a=>1, b=>{1,2}, c=>{1=>2}, d=>{1=>{2,3}}'::hstore %> 2;
694 SELECT 'n=>NULL, a=>1, b=>{1,2}, c=>{1=>2}, d=>{1=>{2,3}}'::hstore %> 1;
700 SELECT 'n=>NULL, a=>1, b=>{1,2}, c=>{1=>2}, d=>{1=>{2,3}}'::hstore %> 0;
706 SELECT '[a,b, c,{1,2}, NULL]'::hstore %> 5;
712 SELECT '[a,b, c,{1,2}, NULL]'::hstore %> 4;
718 SELECT '[a,b, c,{1,2}, NULL]'::hstore %> 3;
724 SELECT '[a,b, c,{1,2}, NULL]'::hstore %> 2;
730 SELECT '[a,b, c,{1,2}, NULL]'::hstore %> 1;
736 SELECT '[a,b, c,{1,2}, NULL]'::hstore %> 0;
743 SELECT 'n=>NULL, a=>1, b=>{1,2}, c=>{1=>2}, d=>{1=>{2,3}}'::hstore -> 5;
749 SELECT 'n=>NULL, a=>1, b=>{1,2}, c=>{1=>2}, d=>{1=>{2,3}}'::hstore -> 4;
755 SELECT 'n=>NULL, a=>1, b=>{1,2}, c=>{1=>2}, d=>{1=>{2,3}}'::hstore -> 3;
761 SELECT 'n=>NULL, a=>1, b=>{1,2}, c=>{1=>2}, d=>{1=>{2,3}}'::hstore -> 2;
767 SELECT 'n=>NULL, a=>1, b=>{1,2}, c=>{1=>2}, d=>{1=>{2,3}}'::hstore -> 1;
773 SELECT 'n=>NULL, a=>1, b=>{1,2}, c=>{1=>2}, d=>{1=>{2,3}}'::hstore -> 0;
779 SELECT '[a,b, c,{1,2}, NULL]'::hstore -> 5;
785 SELECT '[a,b, c,{1,2}, NULL]'::hstore -> 4;
791 SELECT '[a,b, c,{1,2}, NULL]'::hstore -> 3;
797 SELECT '[a,b, c,{1,2}, NULL]'::hstore -> 2;
803 SELECT '[a,b, c,{1,2}, NULL]'::hstore -> 1;
809 SELECT '[a,b, c,{1,2}, NULL]'::hstore -> 0;
815 SELECT 'n=>NULL, a=>1, b=>{1,2}, c=>{1=>2}, d=>{1=>{2,3}}'::hstore -> -6;
821 SELECT 'n=>NULL, a=>1, b=>{1,2}, c=>{1=>2}, d=>{1=>{2,3}}'::hstore -> -5;
827 SELECT 'n=>NULL, a=>1, b=>{1,2}, c=>{1=>2}, d=>{1=>{2,3}}'::hstore -> -4;
833 SELECT 'n=>NULL, a=>1, b=>{1,2}, c=>{1=>2}, d=>{1=>{2,3}}'::hstore -> -3;
839 SELECT 'n=>NULL, a=>1, b=>{1,2}, c=>{1=>2}, d=>{1=>{2,3}}'::hstore -> -2;
845 SELECT 'n=>NULL, a=>1, b=>{1,2}, c=>{1=>2}, d=>{1=>{2,3}}'::hstore -> -1;
851 SELECT '[a,b, c,{1,2}, NULL]'::hstore -> -6;
857 SELECT '[a,b, c,{1,2}, NULL]'::hstore -> -5;
863 SELECT '[a,b, c,{1,2}, NULL]'::hstore -> -4;
869 SELECT '[a,b, c,{1,2}, NULL]'::hstore -> -3;
875 SELECT '[a,b, c,{1,2}, NULL]'::hstore -> -2;
881 SELECT '[a,b, c,{1,2}, NULL]'::hstore -> -1;
888 SELECT 'a=>b, c=>{1,2,3}'::hstore #> '{0}';
894 SELECT 'a=>b, c=>{1,2,3}'::hstore #> '{a}';
900 SELECT 'a=>b, c=>{1,2,3}'::hstore #> '{c}';
906 SELECT 'a=>b, c=>{1,2,3}'::hstore #> '{c, 0}';
912 SELECT 'a=>b, c=>{1,2,3}'::hstore #> '{c, 1}';
918 SELECT 'a=>b, c=>{1,2,3}'::hstore #> '{c, 2}';
924 SELECT 'a=>b, c=>{1,2,3}'::hstore #> '{c, 3}';
930 SELECT 'a=>b, c=>{1,2,3}'::hstore #> '{c, -1}';
936 SELECT 'a=>b, c=>{1,2,3}'::hstore #> '{c, -2}';
942 SELECT 'a=>b, c=>{1,2,3}'::hstore #> '{c, -3}';
948 SELECT 'a=>b, c=>{1,2,3}'::hstore #> '{c, -4}';
954 SELECT '[0, 1, 2, {3,4}, {5=>five}]'::hstore #> '{0}';
960 SELECT '[0, 1, 2, {3,4}, {5=>five}]'::hstore #> '{3}';
966 SELECT '[0, 1, 2, {3,4}, {5=>five}]'::hstore #> '{4}';
972 SELECT '[0, 1, 2, {3,4}, {5=>five}]'::hstore #> '{4,5}';
979 SELECT 'a=>b, c=>{1,2,3}'::hstore #%> '{0}';
985 SELECT 'a=>b, c=>{1,2,3}'::hstore #%> '{a}';
991 SELECT 'a=>b, c=>{1,2,3}'::hstore #%> '{c}';
997 SELECT 'a=>b, c=>{1,2,3}'::hstore #%> '{c, 0}';
1003 SELECT 'a=>b, c=>{1,2,3}'::hstore #%> '{c, 1}';
1009 SELECT 'a=>b, c=>{1,2,3}'::hstore #%> '{c, 2}';
1015 SELECT 'a=>b, c=>{1,2,3}'::hstore #%> '{c, 3}';
1021 SELECT 'a=>b, c=>{1,2,3}'::hstore #%> '{c, -1}';
1027 SELECT 'a=>b, c=>{1,2,3}'::hstore #%> '{c, -2}';
1033 SELECT 'a=>b, c=>{1,2,3}'::hstore #%> '{c, -3}';
1039 SELECT 'a=>b, c=>{1,2,3}'::hstore #%> '{c, -4}';
1045 SELECT '[0, 1, 2, {3,4}, {5=>five}]'::hstore #%> '{0}';
1051 SELECT '[0, 1, 2, {3,4}, {5=>five}]'::hstore #%> '{3}';
1057 SELECT '[0, 1, 2, {3,4}, {5=>five}]'::hstore #%> '{4}';
1063 SELECT '[0, 1, 2, {3,4}, {5=>five}]'::hstore #%> '{4,5}';
1070 SELECT 'n=>NULL, a=>1, b=>{1,2}, c=>{1=>2}, d=>{1=>{2,3}}'::hstore ? 5;
1076 SELECT 'n=>NULL, a=>1, b=>{1,2}, c=>{1=>2}, d=>{1=>{2,3}}'::hstore ? 4;
1082 SELECT 'n=>NULL, a=>1, b=>{1,2}, c=>{1=>2}, d=>{1=>{2,3}}'::hstore ? 3;
1088 SELECT 'n=>NULL, a=>1, b=>{1,2}, c=>{1=>2}, d=>{1=>{2,3}}'::hstore ? 2;
1094 SELECT 'n=>NULL, a=>1, b=>{1,2}, c=>{1=>2}, d=>{1=>{2,3}}'::hstore ? 1;
1100 SELECT 'n=>NULL, a=>1, b=>{1,2}, c=>{1=>2}, d=>{1=>{2,3}}'::hstore ? 0;
1106 SELECT '[a,b, c,{1,2}, NULL]'::hstore ? 5;
1112 SELECT '[a,b, c,{1,2}, NULL]'::hstore ? 4;
1118 SELECT '[a,b, c,{1,2}, NULL]'::hstore ? 3;
1124 SELECT '[a,b, c,{1,2}, NULL]'::hstore ? 2;
1130 SELECT '[a,b, c,{1,2}, NULL]'::hstore ? 1;
1136 SELECT '[a,b, c,{1,2}, NULL]'::hstore ? 0;
1142 SELECT 'n=>NULL, a=>1, b=>{1,2}, c=>{1=>2}, d=>{1=>{2,3}}'::hstore ? -6;
1148 SELECT 'n=>NULL, a=>1, b=>{1,2}, c=>{1=>2}, d=>{1=>{2,3}}'::hstore ? -5;
1154 SELECT 'n=>NULL, a=>1, b=>{1,2}, c=>{1=>2}, d=>{1=>{2,3}}'::hstore ? -4;
1160 SELECT 'n=>NULL, a=>1, b=>{1,2}, c=>{1=>2}, d=>{1=>{2,3}}'::hstore ? -3;
1166 SELECT 'n=>NULL, a=>1, b=>{1,2}, c=>{1=>2}, d=>{1=>{2,3}}'::hstore ? -2;
1172 SELECT 'n=>NULL, a=>1, b=>{1,2}, c=>{1=>2}, d=>{1=>{2,3}}'::hstore ? -1;
1178 SELECT '[a,b, c,{1,2}, NULL]'::hstore ? -6;
1184 SELECT '[a,b, c,{1,2}, NULL]'::hstore ? -5;
1190 SELECT '[a,b, c,{1,2}, NULL]'::hstore ? -4;
1196 SELECT '[a,b, c,{1,2}, NULL]'::hstore ? -3;
1202 SELECT '[a,b, c,{1,2}, NULL]'::hstore ? -2;
1208 SELECT '[a,b, c,{1,2}, NULL]'::hstore ? -1;
1214 SELECT 'a=>b, c=>{1,2,3}'::hstore #? '{0}'::text[];
1220 SELECT 'a=>b, c=>{1,2,3}'::hstore #? '{a}'::text[];
1226 SELECT 'a=>b, c=>{1,2,3}'::hstore #? '{c}'::text[];
1232 SELECT 'a=>b, c=>{1,2,3}'::hstore #? '{b}'::text[];
1238 SELECT 'a=>b, c=>{1,2,3}'::hstore #? '{c, 0}'::text[];
1244 SELECT 'a=>b, c=>{1,2,3}'::hstore #? '{c, 1}'::text[];
1250 SELECT 'a=>b, c=>{1,2,3}'::hstore #? '{c, 2}'::text[];
1256 SELECT 'a=>b, c=>{1,2,3}'::hstore #? '{c, 3}'::text[];
1262 SELECT 'a=>b, c=>{1,2,3}'::hstore #? '{c, -1}'::text[];
1268 SELECT 'a=>b, c=>{1,2,3}'::hstore #? '{c, -2}'::text[];
1274 SELECT 'a=>b, c=>{1,2,3}'::hstore #? '{c, -3}'::text[];
1280 SELECT 'a=>b, c=>{1,2,3}'::hstore #? '{c, -4}'::text[];
1286 SELECT 'a=>b, c=>{1,2,3}'::hstore #? '{c, -5}'::text[];
1292 SELECT '[0, 1, 2, {3,4}, {5=>five}]'::hstore #? '{0}'::text[];
1298 SELECT '[0, 1, 2, {3,4}, {5=>five}]'::hstore #? '{3}'::text[];
1304 SELECT '[0, 1, 2, {3,4}, {5=>five}]'::hstore #? '{4}'::text[];
1310 SELECT '[0, 1, 2, {3,4}, {5=>five}]'::hstore #? '{4,5}'::text[];
1317 SELECT 'a=>1'::hstore #- '{x}';
1323 SELECT 'a=>1'::hstore #- '{a}';
1329 SELECT 'a=>1'::hstore #- '{NULL}';
1335 SELECT 'a=>1, b=>2, c=>3'::hstore #- '{x}';
1337 ------------------------
1338 "a"=>1, "b"=>2, "c"=>3
1341 SELECT 'a=>1, b=>2, c=>3'::hstore #- '{a}';
1347 SELECT 'a=>1, b=>2, c=>3'::hstore #- '{b}';
1353 SELECT 'a=>1, b=>2, c=>3'::hstore #- '{c}';
1359 SELECT 'a=>1'::hstore #- '{x,1}';
1365 SELECT 'a=>1'::hstore #- '{a,1}';
1371 SELECT 'a=>1'::hstore #- '{NULL,1}';
1377 SELECT 'a=>1, b=>2, c=>3'::hstore #- '{x,1}';
1379 ------------------------
1380 "a"=>1, "b"=>2, "c"=>3
1383 SELECT 'a=>1, b=>2, c=>3'::hstore #- '{a,1}';
1385 ------------------------
1386 "a"=>1, "b"=>2, "c"=>3
1389 SELECT 'a=>1, b=>2, c=>3'::hstore #- '{b,1}';
1391 ------------------------
1392 "a"=>1, "b"=>2, "c"=>3
1395 SELECT 'a=>1, b=>2, c=>3'::hstore #- '{c,1}';
1397 ------------------------
1398 "a"=>1, "b"=>2, "c"=>3
1401 SELECT '[a]'::hstore #- '{2}';
1407 SELECT '[a]'::hstore #- '{1}';
1413 SELECT '[a]'::hstore #- '{0}';
1419 SELECT '[a]'::hstore #- '{-1}';
1425 SELECT '[a]'::hstore #- '{-2}';
1431 SELECT '[a,b,c]'::hstore #- '{3}';
1437 SELECT '[a,b,c]'::hstore #- '{2}';
1443 SELECT '[a,b,c]'::hstore #- '{1}';
1449 SELECT '[a,b,c]'::hstore #- '{0}';
1455 SELECT '[a,b,c]'::hstore #- '{-1}';
1461 SELECT '[a,b,c]'::hstore #- '{-2}';
1467 SELECT '[a,b,c]'::hstore #- '{-3}';
1473 SELECT '[a,b,c]'::hstore #- '{-4}';
1479 SELECT '[a,b,c]'::hstore #- '{0,0}';
1485 SELECT 'n=>NULL, a=>1, b=>{1,2}, c=>{1=>2}, d=>{1=>{2,3}}'::hstore #- '{x}';
1487 -------------------------------------------------------------------
1488 "a"=>1, "b"=>[1, 2], "c"=>{"1"=>2}, "d"=>{"1"=>[2, 3]}, "n"=>NULL
1491 SELECT 'n=>NULL, a=>1, b=>{1,2}, c=>{1=>2}, d=>{1=>{2,3}}'::hstore #- '{a}';
1493 -----------------------------------------------------------
1494 "b"=>[1, 2], "c"=>{"1"=>2}, "d"=>{"1"=>[2, 3]}, "n"=>NULL
1497 SELECT 'n=>NULL, a=>1, b=>{1,2}, c=>{1=>2}, d=>{1=>{2,3}}'::hstore #- '{b}';
1499 ------------------------------------------------------
1500 "a"=>1, "c"=>{"1"=>2}, "d"=>{"1"=>[2, 3]}, "n"=>NULL
1503 SELECT 'n=>NULL, a=>1, b=>{1,2}, c=>{1=>2}, d=>{1=>{2,3}}'::hstore #- '{c}';
1505 ----------------------------------------------------
1506 "a"=>1, "b"=>[1, 2], "d"=>{"1"=>[2, 3]}, "n"=>NULL
1509 SELECT 'n=>NULL, a=>1, b=>{1,2}, c=>{1=>2}, d=>{1=>{2,3}}'::hstore #- '{d}';
1511 -----------------------------------------------
1512 "a"=>1, "b"=>[1, 2], "c"=>{"1"=>2}, "n"=>NULL
1515 SELECT 'n=>NULL, a=>1, b=>{1,2}, c=>{1=>2}, d=>{1=>{2,3}}'::hstore #- '{b, 0}';
1517 ----------------------------------------------------------------
1518 "a"=>1, "b"=>[2], "c"=>{"1"=>2}, "d"=>{"1"=>[2, 3]}, "n"=>NULL
1521 SELECT 'n=>NULL, a=>1, b=>{1,2}, c=>{1=>2}, d=>{1=>{2,3}}'::hstore #- '{b, -1}';
1523 ----------------------------------------------------------------
1524 "a"=>1, "b"=>[1], "c"=>{"1"=>2}, "d"=>{"1"=>[2, 3]}, "n"=>NULL
1527 SELECT 'n=>NULL, a=>1, b=>{1,2}, c=>{1=>2}, d=>{1=>{2,3}}'::hstore #- '{b, -1}' #- '{b, -1}';
1529 -----------------------------------------------------------------
1530 "a"=>1, "b"=>NULL, "c"=>{"1"=>2}, "d"=>{"1"=>[2, 3]}, "n"=>NULL
1533 SELECT 'n=>NULL, a=>1, b=>{1,2}, c=>{1=>2}, d=>{1=>{2,3}}'::hstore #- '{c, 1}';
1535 ---------------------------------------------------------------
1536 "a"=>1, "b"=>[1, 2], "c"=>NULL, "d"=>{"1"=>[2, 3]}, "n"=>NULL
1539 SELECT 'n=>NULL, a=>1, b=>{1,2}, c=>{1=>2}, d=>{1=>{2,3}}'::hstore #- '{c, 2}';
1541 -------------------------------------------------------------------
1542 "a"=>1, "b"=>[1, 2], "c"=>{"1"=>2}, "d"=>{"1"=>[2, 3]}, "n"=>NULL
1545 SELECT 'n=>NULL, a=>1, b=>{1,2}, c=>{1=>2}, d=>{1=>{2,3}}'::hstore #- '{d, 1, -2}';
1547 ----------------------------------------------------------------
1548 "a"=>1, "b"=>[1, 2], "c"=>{"1"=>2}, "d"=>{"1"=>[3]}, "n"=>NULL
1551 SELECT 'n=>NULL, a=>1, b=>{1,2}, c=>{1=>2}, d=>{1=>{2,3}}'::hstore #- '{d, 1, 1}';
1553 ----------------------------------------------------------------
1554 "a"=>1, "b"=>[1, 2], "c"=>{"1"=>2}, "d"=>{"1"=>[2]}, "n"=>NULL
1557 SELECT 'n=>NULL, a=>1, b=>{1,2}, c=>{1=>2}, d=>{1=>{2,3}}'::hstore #- '{d, 1, 0}';
1559 ----------------------------------------------------------------
1560 "a"=>1, "b"=>[1, 2], "c"=>{"1"=>2}, "d"=>{"1"=>[3]}, "n"=>NULL
1563 SELECT 'n=>NULL, a=>1, b=>{1,2}, c=>{1=>2}, d=>{1=>{2,3}}'::hstore #- '{d, 1, 0}' #- '{d, 1, 0}';
1565 -----------------------------------------------------------------
1566 "a"=>1, "b"=>[1, 2], "c"=>{"1"=>2}, "d"=>{"1"=>NULL}, "n"=>NULL
1569 SELECT 'n=>NULL, a=>1, b=>{1,2}, c=>{1=>2}, d=>{1=>{2,3}}'::hstore #- '{d, 1, 0}' #- '{d, 1, 0}' #- '{d, 1, 0}';
1571 -----------------------------------------------------------------
1572 "a"=>1, "b"=>[1, 2], "c"=>{"1"=>2}, "d"=>{"1"=>NULL}, "n"=>NULL
1576 SELECT '[a,b,c]'::hstore - 3;
1582 SELECT '[a,b,c]'::hstore - 2;
1588 SELECT '[a,b,c]'::hstore - 1;
1594 SELECT '[a,b,c]'::hstore - 0;
1600 SELECT '[a,b,c]'::hstore - -1;
1606 SELECT '[a,b,c]'::hstore - -2;
1612 SELECT '[a,b,c]'::hstore - -3;
1618 SELECT '[a,b,c]'::hstore - -4;
1624 SELECT 'a=>1, b=>2, c=>3'::hstore - 3;
1626 ------------------------
1627 "a"=>1, "b"=>2, "c"=>3
1630 SELECT 'a=>1, b=>2, c=>3'::hstore - 2;
1636 SELECT 'a=>1, b=>2, c=>3'::hstore - 1;
1642 SELECT 'a=>1, b=>2, c=>3'::hstore - 0;
1648 SELECT 'a=>1, b=>2, c=>3'::hstore - -1;
1654 SELECT 'a=>1, b=>2, c=>3'::hstore - -2;
1660 SELECT 'a=>1, b=>2, c=>3'::hstore - -3;
1666 SELECT 'a=>1, b=>2, c=>3'::hstore - -4;
1668 ------------------------
1669 "a"=>1, "b"=>2, "c"=>3
1673 SELECT replace('n=>NULL, a=>1, b=>{1,2}, c=>{1=>2}, d=>{1=>{2,3}}'::hstore, '{n}', '{1,2,3}');
1675 ------------------------------------------------------------------------
1676 "a"=>1, "b"=>[1, 2], "c"=>{"1"=>2}, "d"=>{"1"=>[2, 3]}, "n"=>[1, 2, 3]
1679 SELECT replace('n=>NULL, a=>1, b=>{1,2}, c=>{1=>2}, d=>{1=>{2,3}}'::hstore, '{b,-1}', '{1,2,3}');
1681 ---------------------------------------------------------------------------
1682 "a"=>1, "b"=>[1, [1, 2, 3]], "c"=>{"1"=>2}, "d"=>{"1"=>[2, 3]}, "n"=>NULL
1685 SELECT replace('n=>NULL, a=>1, b=>{1,2}, c=>{1=>2}, d=>{1=>{2,3}}'::hstore, '{d,1,0}', '{1,2,3}');
1687 ---------------------------------------------------------------------------
1688 "a"=>1, "b"=>[1, 2], "c"=>{"1"=>2}, "d"=>{"1"=>[[1, 2, 3], 3]}, "n"=>NULL
1691 SELECT replace('n=>NULL, a=>1, b=>{1,2}, c=>{1=>2}, d=>{1=>{2,3}}'::hstore, '{d,NULL,0}', '{1,2,3}');
1693 -------------------------------------------------------------------
1694 "a"=>1, "b"=>[1, 2], "c"=>{"1"=>2}, "d"=>{"1"=>[2, 3]}, "n"=>NULL
1698 SELECT concat_path('n=>NULL, a=>1, b=>{1,2}, c=>{1=>2}, d=>{1=>{2,3}}'::hstore, '{}', 'n=>not_null');
1700 -------------------------------------------------------------------------
1701 "a"=>1, "b"=>[1, 2], "c"=>{"1"=>2}, "d"=>{"1"=>[2, 3]}, "n"=>"not_null"
1704 SELECT concat_path('n=>NULL, a=>1, b=>{1,2}, c=>{1=>2}, d=>{1=>{2,3}}'::hstore, '{n}', 'n=>not_null');
1706 --------------------------------------------------------------------------------
1707 "a"=>1, "b"=>[1, 2], "c"=>{"1"=>2}, "d"=>{"1"=>[2, 3]}, "n"=>{"n"=>"not_null"}
1710 SELECT concat_path('n=>NULL, a=>1, b=>{1,2}, c=>{1=>2}, d=>{1=>{2,3}}'::hstore, '{n}', 'not_null');
1712 -------------------------------------------------------------------------
1713 "a"=>1, "b"=>[1, 2], "c"=>{"1"=>2}, "d"=>{"1"=>[2, 3]}, "n"=>"not_null"
1716 SELECT concat_path('n=>NULL, a=>1, b=>{1,2}, c=>{1=>2}, d=>{1=>{2,3}}'::hstore, '{n}', '{not_null}');
1718 ---------------------------------------------------------------------------
1719 "a"=>1, "b"=>[1, 2], "c"=>{"1"=>2}, "d"=>{"1"=>[2, 3]}, "n"=>["not_null"]
1722 SELECT concat_path('n=>NULL, a=>1, b=>{1,2}, c=>{1=>2}, d=>{1=>{2,3}}'::hstore, '{}', 'b=>{3,4}');
1724 -------------------------------------------------------------------
1725 "a"=>1, "b"=>[3, 4], "c"=>{"1"=>2}, "d"=>{"1"=>[2, 3]}, "n"=>NULL
1728 SELECT concat_path('n=>NULL, a=>1, b=>{1,2}, c=>{1=>2}, d=>{1=>{2,3}}'::hstore, '{b}', '{3,4}');
1730 -------------------------------------------------------------------------
1731 "a"=>1, "b"=>[1, 2, 3, 4], "c"=>{"1"=>2}, "d"=>{"1"=>[2, 3]}, "n"=>NULL
1734 SELECT concat_path('n=>NULL, a=>1, b=>{1,2}, c=>{1=>2}, d=>{1=>{2,3}}'::hstore, '{d,1}', '{4,5}');
1736 -------------------------------------------------------------------------
1737 "a"=>1, "b"=>[1, 2], "c"=>{"1"=>2}, "d"=>{"1"=>[2, 3, 4, 5]}, "n"=>NULL
1740 SELECT concat_path('n=>NULL, a=>1, b=>{1,2}, c=>{1=>2}, d=>{1=>{2,3}}'::hstore, '{d,1}', '4=>5');
1742 ---------------------------------------------------------------------------
1743 "a"=>1, "b"=>[1, 2], "c"=>{"1"=>2}, "d"=>{"1"=>[2, 3, "4", 5]}, "n"=>NULL
1746 SELECT concat_path('n=>NULL, a=>1, b=>{1,2}, c=>{1=>2}, d=>{1=>{2,3}}'::hstore, '{d}', '2=>{4,5}');
1748 --------------------------------------------------------------------------------
1749 "a"=>1, "b"=>[1, 2], "c"=>{"1"=>2}, "d"=>{"1"=>[2, 3], "2"=>[4, 5]}, "n"=>NULL
1752 SELECT concat_path('n=>NULL, a=>1, b=>{1,2}, c=>{1=>2}, d=>{1=>{2,3}}'::hstore, '{NULL,1}', '4=>5');
1754 -------------------------------------------------------------------
1755 "a"=>1, "b"=>[1, 2], "c"=>{"1"=>2}, "d"=>{"1"=>[2, 3]}, "n"=>NULL
1758 SELECT concat_path('x'::hstore, '{}'::text[], 'a=>"1"':: hstore);
1765 SELECT ('{"f2":{"f3":1},"f4":{"f5":99,"f6":"stringy"}}'::text)::hstore AS err;
1766 ERROR: bad hstore representation
1767 DETAIL: syntax error, unexpected STRING_P, expecting '}' or ',' at end of input
1768 SELECT ('{"f2":{"f3":1},"f4":{"f5":99,"f6":"stringy"}}'::json)::hstore AS ok;
1770 ----------------------------------------------------
1771 "f2"=>{"f3"=>1}, "f4"=>{"f5"=>99, "f6"=>"stringy"}
1775 SELECT q->'tags' FROM hvals('{{tags=>1, sh=>2}, {tags=>3, sh=>4}}'::hstore) AS q;
1782 SELECT q FROM hvals('{{tags=>1, sh=>2}, {tags=>3, sh=>4}}'::hstore, '{}') AS q;
1784 ----------------------------------------------
1785 [{"sh"=>2, "tags"=>1}, {"sh"=>4, "tags"=>3}]
1788 SELECT q FROM hvals('{{tags=>1, sh=>2}, {tags=>3, sh=>4}}'::hstore, '{-3}') AS q;
1793 SELECT q FROM hvals('{{tags=>1, sh=>2}, {tags=>3, sh=>4}}'::hstore, '{-2}') AS q;
1795 --------------------
1799 SELECT q FROM hvals('{{tags=>1, sh=>2}, {tags=>3, sh=>4}}'::hstore, '{-1}') AS q;
1801 --------------------
1805 SELECT q FROM hvals('{{tags=>1, sh=>2}, {tags=>3, sh=>4}}'::hstore, '{0}') AS q;
1807 --------------------
1811 SELECT q FROM hvals('{{tags=>1, sh=>2}, {tags=>3, sh=>4}}'::hstore, '{1}') AS q;
1813 --------------------
1817 SELECT q FROM hvals('{{tags=>1, sh=>2}, {tags=>3, sh=>4}}'::hstore, '{2}') AS q;
1822 SELECT q FROM hvals('{{tags=>1, sh=>2}, {tags=>3, sh=>4}}'::hstore, '{NULL}') AS q;
1824 --------------------
1829 SELECT q FROM hvals('{{tags=>1, sh=>2}, {tags=>3, sh=>4}}'::hstore, '{-3,tags}') AS q;
1834 SELECT q FROM hvals('{{tags=>1, sh=>2}, {tags=>3, sh=>4}}'::hstore, '{-2,tags}') AS q;
1840 SELECT q FROM hvals('{{tags=>1, sh=>2}, {tags=>3, sh=>4}}'::hstore, '{-1,tags}') AS q;
1846 SELECT q FROM hvals('{{tags=>1, sh=>2}, {tags=>3, sh=>4}}'::hstore, '{0,tags}') AS q;
1852 SELECT q FROM hvals('{{tags=>1, sh=>2}, {tags=>3, sh=>4}}'::hstore, '{1,tags}') AS q;
1858 SELECT q FROM hvals('{{tags=>1, sh=>2}, {tags=>3, sh=>4}}'::hstore, '{2,tags}') AS q;
1863 SELECT q FROM hvals('{{tags=>1, sh=>2}, {tags=>3, sh=>4}}'::hstore, '{NULL,tags}') AS q;
1870 SELECT q FROM hvals('a=>{b=>c, c=>b}, b=>{1,2}, c=>cc, 1=>first'::hstore, '{}') AS q;
1872 -----------------------------------------------------------------
1873 "1"=>"first", "a"=>{"b"=>"c", "c"=>"b"}, "b"=>[1, 2], "c"=>"cc"
1876 SELECT q FROM hvals('a=>{b=>c, c=>b}, b=>{1,2}, c=>cc, 1=>first'::hstore, '{1}') AS q;
1882 SELECT q FROM hvals('a=>{b=>c, c=>b}, b=>{1,2}, c=>cc, 1=>first'::hstore, '{a}') AS q;
1884 --------------------
1888 SELECT q FROM hvals('a=>{b=>c, c=>b}, b=>{1,2}, c=>cc, 1=>first'::hstore, '{b}') AS q;
1894 SELECT q FROM hvals('a=>{b=>c, c=>b}, b=>{1,2}, c=>cc, 1=>first'::hstore, '{c}') AS q;
1900 SELECT q FROM hvals('a=>{b=>c, c=>b}, b=>{1,2}, c=>cc, 1=>first'::hstore, '{NULL}') AS q;
1902 --------------------
1909 SELECT q FROM hvals('a=>{b=>c, c=>b}, b=>{1,2}, c=>cc, 1=>first'::hstore, '{a,c}') AS q;
1915 SELECT q FROM hvals('a=>{b=>c, c=>b}, b=>{1,2}, c=>cc, 1=>first'::hstore, '{NULL,c}') AS q;
1921 SELECT q FROM hvals('a=>{b=>c, c=>b}, b=>{1,2}, c=>cc, 1=>first'::hstore, '{b,NULL}') AS q;
1928 SELECT q FROM hvals('a=>{b=>c, c=>b}, b=>{1,2}, c=>cc, 1=>first'::hstore, '{NULL,1}') AS q;
1934 SELECT q FROM hvals('a=>{b=>c, c=>b, 1=>first}, b=>{1,2}, c=>cc, 1=>first'::hstore, '{NULL,1}') AS q;
1942 SELECT q FROM svals('{{tags=>1, sh=>2}, {tags=>3, sh=>4}}'::hstore, '{}') AS q;
1944 ----------------------------------------------
1945 [{"sh"=>2, "tags"=>1}, {"sh"=>4, "tags"=>3}]
1948 SELECT q FROM svals('{{tags=>1, sh=>2}, {tags=>3, sh=>4}}'::hstore, '{-3}') AS q;
1953 SELECT q FROM svals('{{tags=>1, sh=>2}, {tags=>3, sh=>4}}'::hstore, '{-2}') AS q;
1955 --------------------
1959 SELECT q FROM svals('{{tags=>1, sh=>2}, {tags=>3, sh=>4}}'::hstore, '{-1}') AS q;
1961 --------------------
1965 SELECT q FROM svals('{{tags=>1, sh=>2}, {tags=>3, sh=>4}}'::hstore, '{0}') AS q;
1967 --------------------
1971 SELECT q FROM svals('{{tags=>1, sh=>2}, {tags=>3, sh=>4}}'::hstore, '{1}') AS q;
1973 --------------------
1977 SELECT q FROM svals('{{tags=>1, sh=>2}, {tags=>3, sh=>4}}'::hstore, '{2}') AS q;
1982 SELECT q FROM svals('{{tags=>1, sh=>2}, {tags=>3, sh=>4}}'::hstore, '{NULL}') AS q;
1984 --------------------
1989 SELECT q FROM svals('{{tags=>1, sh=>2}, {tags=>3, sh=>4}}'::hstore, '{-3,tags}') AS q;
1994 SELECT q FROM svals('{{tags=>1, sh=>2}, {tags=>3, sh=>4}}'::hstore, '{-2,tags}') AS q;
2000 SELECT q FROM svals('{{tags=>1, sh=>2}, {tags=>3, sh=>4}}'::hstore, '{-1,tags}') AS q;
2006 SELECT q FROM svals('{{tags=>1, sh=>2}, {tags=>3, sh=>4}}'::hstore, '{0,tags}') AS q;
2012 SELECT q FROM svals('{{tags=>1, sh=>2}, {tags=>3, sh=>4}}'::hstore, '{1,tags}') AS q;
2018 SELECT q FROM svals('{{tags=>1, sh=>2}, {tags=>3, sh=>4}}'::hstore, '{2,tags}') AS q;
2023 SELECT q FROM svals('{{tags=>1, sh=>2}, {tags=>3, sh=>4}}'::hstore, '{NULL,tags}') AS q;
2030 SELECT q FROM svals('a=>{b=>c, c=>b}, b=>{1,2}, c=>cc, 1=>first'::hstore, '{}') AS q;
2032 -----------------------------------------------------------------
2033 "1"=>"first", "a"=>{"b"=>"c", "c"=>"b"}, "b"=>[1, 2], "c"=>"cc"
2036 SELECT q FROM svals('a=>{b=>c, c=>b}, b=>{1,2}, c=>cc, 1=>first'::hstore, '{1}') AS q;
2042 SELECT q FROM svals('a=>{b=>c, c=>b}, b=>{1,2}, c=>cc, 1=>first'::hstore, '{a}') AS q;
2044 --------------------
2048 SELECT q FROM svals('a=>{b=>c, c=>b}, b=>{1,2}, c=>cc, 1=>first'::hstore, '{b}') AS q;
2054 SELECT q FROM svals('a=>{b=>c, c=>b}, b=>{1,2}, c=>cc, 1=>first'::hstore, '{c}') AS q;
2060 SELECT q FROM svals('a=>{b=>c, c=>b}, b=>{1,2}, c=>cc, 1=>first'::hstore, '{NULL}') AS q;
2062 --------------------
2069 SELECT q FROM svals('a=>{b=>c, c=>b}, b=>{1,2}, c=>cc, 1=>first'::hstore, '{a,c}') AS q;
2075 SELECT q FROM svals('a=>{b=>c, c=>b}, b=>{1,2}, c=>cc, 1=>first'::hstore, '{NULL,c}') AS q;
2081 SELECT q FROM svals('a=>{b=>c, c=>b}, b=>{1,2}, c=>cc, 1=>first'::hstore, '{b,NULL}') AS q;
2088 SELECT q FROM svals('a=>{b=>c, c=>b}, b=>{1,2}, c=>cc, 1=>first'::hstore, '{NULL,1}') AS q;
2094 SELECT q FROM svals('a=>{b=>c, c=>b, 1=>first}, b=>{1,2}, c=>cc, 1=>first'::hstore, '{NULL,1}') AS q;
2102 SELECT * FROM each('a=>b, c=>cc'::hstore) AS q;
2109 SELECT * FROM each('[a, b, c, cc]'::hstore) AS q;
2118 SELECT * FROM each('a=>{b=>c, c=>b, 1=>first}, b=>{1,2}, c=>cc, 1=>first, n=>null'::hstore) AS q;
2120 -----+----------------------------------
2122 a | "1"=>"first", "b"=>"c", "c"=>"b"
2128 SELECT * FROM each_hstore('a=>b, c=>cc'::hstore) AS q;
2135 SELECT * FROM each_hstore('[a, b, c, cc]'::hstore) AS q;
2144 SELECT * FROM each_hstore('a=>{b=>c, c=>b, 1=>first}, b=>{1,2}, c=>cc, 1=>first, n=>null'::hstore) AS q;
2146 -----+----------------------------------
2148 a | "1"=>"first", "b"=>"c", "c"=>"b"
2155 SELECT 'a=>1, b=>{c=>3}, d=>[4,[5]]'::hstore AS h, '[a, {b=>c}, [c, d, e]]'::hstore AS a;
2157 --------------------------------------+------------------------------------
2158 "a"=>1, "b"=>{"c"=>3}, "d"=>[4, [5]] | ["a", {"b"=>"c"}, ["c", "d", "e"]]
2161 SET hstore.pretty_print = true;
2162 SELECT 'a=>1, b=>{c=>3}, d=>[4,[5]], e=>[1,2,3,4], f=>g, g=>j'::hstore AS h,
2163 '[a, {b=>c, c=>d}, [c, d, e, [1,2], h, {f=>g, g=>f}]]'::hstore AS a;
2165 ------------+------------------------
2169 "c"=>3+| "b"=>"c", +
2189 RESET hstore.pretty_print;
2190 SELECT hstore_print('a=>t, f=>t, t=>"f", arr=>[1,2,3,"3",x], 123=>string'::hstore);
2192 -----------------------------------------------------------------------
2193 "a"=>t, "f"=>t, "t"=>"f", "123"=>"string", "arr"=>[1, 2, 3, "3", "x"]
2196 SELECT hstore_print('a=>t, f=>t, t=>"f", arr=>[1,2,3,"3",x], 123=>string'::hstore, loose := true );
2198 -------------------------------------------------------------------
2199 "a"=>t, "f"=>t, "t"=>f, "123"=>"string", "arr"=>[1, 2, 3, 3, "x"]
2202 SELECT hstore_print('a=>t, f=>t, t=>"f", arr=>[1,2,3,"3",x], 123=>string'::hstore, root_hash_decorated := true );
2204 -------------------------------------------------------------------------
2205 {"a"=>t, "f"=>t, "t"=>"f", "123"=>"string", "arr"=>[1, 2, 3, "3", "x"]}
2208 SELECT hstore_print('a=>t, f=>t, t=>"f", arr=>[1,2,3,"3",x], 123=>string'::hstore, array_curly_braces := true );
2210 -----------------------------------------------------------------------
2211 "a"=>t, "f"=>t, "t"=>"f", "123"=>"string", "arr"=>{1, 2, 3, "3", "x"}
2214 SELECT hstore_print('a=>t, f=>t, t=>"f", arr=>[1,2,3,"3",x], 123=>string'::hstore, json := true );
2216 -----------------------------------------------------------------------------
2217 "a": true, "f": true, "t": "f", "123": "string", "arr": [1, 2, 3, "3", "x"]
2220 SELECT hstore_print('a=>t, f=>t, t=>"f", arr=>[1,2,3,"3",x], 123=>string'::hstore, json := true, loose := true );
2222 -----------------------------------------------------------------------------
2223 "a": true, "f": true, "t": false, "123": "string", "arr": [1, 2, 3, 3, "x"]
2226 SELECT hstore_print('a=>t, f=>t, t=>"f", arr=>[1,2,3,"3",x], 123=>string'::hstore, json := true, root_hash_decorated := true );
2228 -------------------------------------------------------------------------------
2229 {"a": true, "f": true, "t": "f", "123": "string", "arr": [1, 2, 3, "3", "x"]}
2232 SELECT hstore_print('a=>t, f=>t, t=>"f", arr=>[1,2,3,"3",x], 123=>string'::hstore, json := true, array_curly_braces := true );
2234 -----------------------------------------------------------------------------
2235 "a": true, "f": true, "t": "f", "123": "string", "arr": {1, 2, 3, "3", "x"}
2238 SELECT hstore_print('a=>t, f=>t, t=>"f", arr=>[1,2,3,"3",x], 123=>string'::hstore, loose := true, root_hash_decorated := true );
2240 ---------------------------------------------------------------------
2241 {"a"=>t, "f"=>t, "t"=>f, "123"=>"string", "arr"=>[1, 2, 3, 3, "x"]}
2244 SELECT hstore_print('a=>t, f=>t, t=>"f", arr=>[1,2,3,"3",x], 123=>string'::hstore, loose := true, array_curly_braces := true );
2246 -------------------------------------------------------------------
2247 "a"=>t, "f"=>t, "t"=>f, "123"=>"string", "arr"=>{1, 2, 3, 3, "x"}
2250 SELECT hstore_print('a=>t, f=>t, t=>"f", arr=>[1,2,3,"3",x], 123=>string'::hstore, root_hash_decorated := true, array_curly_braces := true );
2252 -------------------------------------------------------------------------
2253 {"a"=>t, "f"=>t, "t"=>"f", "123"=>"string", "arr"=>{1, 2, 3, "3", "x"}}
2256 SELECT hstore_print('a=>t, f=>t, t=>"f", arr=>[1,2,3,"3",x], 123=>string'::hstore, root_hash_decorated := true, array_curly_braces := true, loose := true);
2258 ---------------------------------------------------------------------
2259 {"a"=>t, "f"=>t, "t"=>f, "123"=>"string", "arr"=>{1, 2, 3, 3, "x"}}