From: Peter Eisentraut Date: Tue, 5 May 2015 02:30:21 +0000 (-0400) Subject: hstore_plpython: Support tests on Python 2.3 X-Git-Tag: REL9_5_ALPHA1~334 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=c0574cd5aa96b988bb1f0287914dcc8b52fb01bd;p=thirdparty%2Fpostgresql.git hstore_plpython: Support tests on Python 2.3 Python 2.3 does not have the sorted() function, so do it the long way. --- diff --git a/contrib/hstore_plpython/expected/hstore_plpython.out b/contrib/hstore_plpython/expected/hstore_plpython.out index 488f01d40be..e26c72d061a 100644 --- a/contrib/hstore_plpython/expected/hstore_plpython.out +++ b/contrib/hstore_plpython/expected/hstore_plpython.out @@ -6,7 +6,9 @@ LANGUAGE plpythonu TRANSFORM FOR TYPE hstore AS $$ assert isinstance(val, dict) -plpy.info(sorted(val.items())) +i = val.items() +i.sort() +plpy.info(i) return len(val) $$; SELECT test1('aa=>bb, cc=>NULL'::hstore); @@ -23,7 +25,9 @@ LANGUAGE plpython2u TRANSFORM FOR TYPE hstore AS $$ assert isinstance(val, dict) -plpy.info(sorted(val.items())) +i = val.items() +i.sort() +plpy.info(i) return len(val) $$; SELECT test1n('aa=>bb, cc=>NULL'::hstore); diff --git a/contrib/hstore_plpython/sql/hstore_plpython.sql b/contrib/hstore_plpython/sql/hstore_plpython.sql index 2d8aab1e7ab..e096df42fae 100644 --- a/contrib/hstore_plpython/sql/hstore_plpython.sql +++ b/contrib/hstore_plpython/sql/hstore_plpython.sql @@ -8,7 +8,9 @@ LANGUAGE plpythonu TRANSFORM FOR TYPE hstore AS $$ assert isinstance(val, dict) -plpy.info(sorted(val.items())) +i = val.items() +i.sort() +plpy.info(i) return len(val) $$; @@ -21,7 +23,9 @@ LANGUAGE plpython2u TRANSFORM FOR TYPE hstore AS $$ assert isinstance(val, dict) -plpy.info(sorted(val.items())) +i = val.items() +i.sort() +plpy.info(i) return len(val) $$;