hstore_plpython: Support tests on Python 2.3
Python 2.3 does not have the sorted() function, so do it the long way.
This commit is contained in:
parent
ad8d6d064c
commit
c0574cd5aa
@ -6,7 +6,9 @@ LANGUAGE plpythonu
|
|||||||
TRANSFORM FOR TYPE hstore
|
TRANSFORM FOR TYPE hstore
|
||||||
AS $$
|
AS $$
|
||||||
assert isinstance(val, dict)
|
assert isinstance(val, dict)
|
||||||
plpy.info(sorted(val.items()))
|
i = val.items()
|
||||||
|
i.sort()
|
||||||
|
plpy.info(i)
|
||||||
return len(val)
|
return len(val)
|
||||||
$$;
|
$$;
|
||||||
SELECT test1('aa=>bb, cc=>NULL'::hstore);
|
SELECT test1('aa=>bb, cc=>NULL'::hstore);
|
||||||
@ -23,7 +25,9 @@ LANGUAGE plpython2u
|
|||||||
TRANSFORM FOR TYPE hstore
|
TRANSFORM FOR TYPE hstore
|
||||||
AS $$
|
AS $$
|
||||||
assert isinstance(val, dict)
|
assert isinstance(val, dict)
|
||||||
plpy.info(sorted(val.items()))
|
i = val.items()
|
||||||
|
i.sort()
|
||||||
|
plpy.info(i)
|
||||||
return len(val)
|
return len(val)
|
||||||
$$;
|
$$;
|
||||||
SELECT test1n('aa=>bb, cc=>NULL'::hstore);
|
SELECT test1n('aa=>bb, cc=>NULL'::hstore);
|
||||||
|
@ -8,7 +8,9 @@ LANGUAGE plpythonu
|
|||||||
TRANSFORM FOR TYPE hstore
|
TRANSFORM FOR TYPE hstore
|
||||||
AS $$
|
AS $$
|
||||||
assert isinstance(val, dict)
|
assert isinstance(val, dict)
|
||||||
plpy.info(sorted(val.items()))
|
i = val.items()
|
||||||
|
i.sort()
|
||||||
|
plpy.info(i)
|
||||||
return len(val)
|
return len(val)
|
||||||
$$;
|
$$;
|
||||||
|
|
||||||
@ -21,7 +23,9 @@ LANGUAGE plpython2u
|
|||||||
TRANSFORM FOR TYPE hstore
|
TRANSFORM FOR TYPE hstore
|
||||||
AS $$
|
AS $$
|
||||||
assert isinstance(val, dict)
|
assert isinstance(val, dict)
|
||||||
plpy.info(sorted(val.items()))
|
i = val.items()
|
||||||
|
i.sort()
|
||||||
|
plpy.info(i)
|
||||||
return len(val)
|
return len(val)
|
||||||
$$;
|
$$;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user