hstore_plpython: Support tests on Python 2.3
authorPeter Eisentraut <peter_e@gmx.net>
Tue, 5 May 2015 02:30:21 +0000 (22:30 -0400)
committerPeter Eisentraut <peter_e@gmx.net>
Tue, 5 May 2015 02:30:21 +0000 (22:30 -0400)
Python 2.3 does not have the sorted() function, so do it the long way.

contrib/hstore_plpython/expected/hstore_plpython.out
contrib/hstore_plpython/sql/hstore_plpython.sql

index 488f01d40bea50a22334d36dbe79091de480c753..e26c72d061af638c351fe619ec0315f46c7bb3b9 100644 (file)
@@ -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);
index 2d8aab1e7ab8f71baaed89e5f257087fd1ed1f50..e096df42fae34b97c532f95b78718c7b76a0c172 100644 (file)
@@ -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)
 $$;