On Mon, January 13, 2014 18:30, Andrew Dunstan wrote: > > > On 01/13/2014 11:16 AM, Oleg Bartunov wrote: >> Andrew, >> >> did you run perl script ? Actually, I found, that operator table needs >> to be fixed. >> > > No. My build machine doesn't actually have DBD::Pg installed. Can you > send me a patch if you don't want to push it yourself, or maybe Erik can > send a pacth top adjust the table. >
> [ nested_hstore_and_jsonb-2.patch ] ( centos 6.5, gcc 4.8.2. ) The patch applies & compiles with warnings (see below). The opr_sanity test fails during make check: regression.diffs attached. Also attached are changes to hstore.sgml, to operator + functions table, plus some typos. Thanks, Erik Rijkers make jsonfuncs.c: In function each_object_field_end_jsonb: jsonfuncs.c:1328:7: warning: assignment from incompatible pointer type [enabled by default] val = DatumGetPointer(DirectFunctionCall1(jsonb_in, CStringGetDatum(cstr))); ^ jsonfuncs.c: In function elements_array_element_end_jsonb: jsonfuncs.c:1530:8: warning: assignment from incompatible pointer type [enabled by default] jbval = DatumGetPointer(DirectFunctionCall1(jsonb_in, CStringGetDatum(cstr))); ^ make contrib: hstore_io.c: In function array_to_hstore: hstore_io.c:1694:30: warning: result may be used uninitialized in this function [-Wmaybe-uninitialized] PG_RETURN_POINTER(hstoreDump(result));
regression.diffs
Description: Binary data
--- doc/src/sgml/hstore.sgml.orig 2014-01-14 00:06:30.070883763 +0100 +++ doc/src/sgml/hstore.sgml 2014-01-14 00:58:53.069334810 +0100 @@ -350,7 +350,7 @@ <entry><type>text[]</></entry> <entry>get values for keys (<literal>NULL</> if not present)</entry> <entry><literal>'a=>x, b=>y, c=>z'::hstore -> ARRAY['c','a']</literal></entry> - <entry><literal>{"z","x"}</literal></entry> + <entry><literal>{z,x}</literal></entry> </row> <row> @@ -422,7 +422,7 @@ <entry><type>hstore</></entry> <entry>delete key from left operand</entry> <entry><literal>'a=>1, b=>2, c=>3'::hstore - 'b'::text</literal></entry> - <entry><literal>"a"=>"1", "c"=>"3"</literal></entry> + <entry><literal>"a"=>1, "c"=>3</literal></entry> </row> <row> @@ -438,7 +438,7 @@ <entry><type>hstore</></entry> <entry>delete keys from left operand</entry> <entry><literal>'a=>1, b=>2, c=>3'::hstore - ARRAY['a','b']</literal></entry> - <entry><literal>"c"=>"3"</literal></entry> + <entry><literal>"c"=>3</literal></entry> </row> <row> @@ -446,14 +446,14 @@ <entry><type>hstore</></entry> <entry>delete matching pairs from left operand</entry> <entry><literal>'a=>1, b=>2, c=>3'::hstore - 'a=>4, b=>2'::hstore</literal></entry> - <entry><literal>"a"=>"1", "c"=>"3"</literal></entry> + <entry><literal>"a"=>1, "c"=>3</literal></entry> </row> <row> <entry><type>hstore</> <literal>#-</> <type>text[]</></entry> <entry><type>hstore</></entry> <entry>delete key path from left operand</entry> - <entry><literal>'{a => {b => { c => [1,2]}}}'::hstore #- '[a,b,c,0]'</literal></entry> + <entry><literal>'{a => {b => { c => [1,2]}}}'::hstore #- '{a,b,c,0}'</literal></entry> <entry><literal>"a"=>{"b"=>{"c"=>[2]}}</literal></entry> </row> @@ -525,7 +525,7 @@ <entry><type>hstore</type></entry> <entry>construct an <type>hstore</> from a record or row</entry> <entry><literal>hstore(ROW(1,2))</literal></entry> - <entry><literal>f1=>1,f2=>2</literal></entry> + <entry><literal>"f1"=>"1","f2"=>"2"</literal></entry> </row> <row> @@ -534,7 +534,7 @@ <entry>construct an <type>hstore</> from an array, which may be either a key/value array, or a two-dimensional array</entry> <entry><literal>hstore(ARRAY['a','1','b','2']) || hstore(ARRAY[['c','3'],['d','4']])</literal></entry> - <entry><literal>a=>1, b=>2, c=>3, d=>4</literal></entry> + <entry><literal>"a"=>"1", "b"=>"2", "c"=>"3", "d"=>"4"</literal></entry> </row> <row> @@ -707,7 +707,7 @@ <entry><type>hstore</type></entry> <entry>extract a subset of an <type>hstore</></entry> <entry><literal>slice('a=>1,b=>2,c=>3'::hstore, ARRAY['b','c','x'])</literal></entry> - <entry><literal>"b"=>"2", "c"=>"3"</literal></entry> + <entry><literal>"b"=>2, "c"=>3</literal></entry> </row> <row> @@ -766,15 +766,15 @@ <entry><function>replace(hstore,text[],hstore)</function><indexterm><primary>replace</primary></indexterm></entry> <entry><type>hstore</type></entry> <entry>replace value at the specified path</entry> - <entry><literal>replace('a=>1,b=>{c=>3,d=>[4,5,6]}'::hstore,'[b,d]', '1')</literal></entry> - <entry><literal>"a"=>1, "b"=>{"c"=>3, "d"=>}</literal></entry> + <entry><literal>replace('a=>1,b=>{c=>3,d=>[4,5,6]}'::hstore,'{b,d}', '1')</literal></entry> + <entry><literal>"a"=>1, "b"=>{"c"=>3, "d"=>1}</literal></entry> </row> <row> <entry><function>concat_path(hstore,text[],hstore)</function><indexterm><primary>concat_path</primary></indexterm></entry> <entry><type>hstore</type></entry> <entry>concatenate <type>hstore</> value at the specified path</entry> - <entry><literal>concat_path('b=>{c=>3,d=>[4,5,6]}'::hstore,'[b,d]', '1')</literal></entry> + <entry><literal>concat_path('b=>{c=>3,d=>[4,5,6]}'::hstore,'{b,d}', '1')</literal></entry> <entry><literal>"b"=>{"c"=>3, "d"=>[4, 5, 6, 1]}</literal></entry> </row> @@ -783,7 +783,7 @@ <entry><type>hstore</type></entry> <entry>delete pair with matching key</entry> <entry><literal>delete('a=>1,b=>2','b')</literal></entry> - <entry><literal>"a"=>"1"</literal></entry> + <entry><literal>"a"=>1</literal></entry> </row> <row> @@ -791,7 +791,7 @@ <entry><type>hstore</type></entry> <entry>delete pairs with matching keys</entry> <entry><literal>delete('a=>1,b=>2,c=>3',ARRAY['a','b'])</literal></entry> - <entry><literal>"c"=>"3"</literal></entry> + <entry><literal>"c"=>3</literal></entry> </row> <row> @@ -799,7 +799,7 @@ <entry><type>hstore</type></entry> <entry>delete pairs matching those in the second argument</entry> <entry><literal>delete('a=>1,b=>2','a=>4,b=>2'::hstore)</literal></entry> - <entry><literal>"a"=>"1"</literal></entry> + <entry><literal>"a"=>1</literal></entry> </row> <row> @@ -1007,7 +1007,7 @@ <para> But <literal>populate_record()</> supports more complicated records and nested - <type>hstore</> values, as well. It makes an effort to convert + <type>hstore</> values as well. It makes an effort to convert from <type>hstore</> data types to PostgreSQL types, including arrays, <type>json</>, and <type>hstore</> values: <programlisting> @@ -1124,7 +1124,7 @@ <para>The internal representation of <type>hstore</> has been updated a couple of times in its history. Data types and nested structures were added in PostgreSQL 9.4, while capacity and improved index support were - introduced in Postgrsql 9.0. These changes present no obstacle for + introduced in PostgreSQL 9.0. These changes present no obstacle for dump/restore upgrades since the text representation (used in the dump) is unchanged. However, <type>hstore</> values dumped from 9.4 cannot be loaded into earlier versions of PostgreSQL if they contain nested values
-- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers