diff --git a/psycopg/typecast_builtins.c b/psycopg/typecast_builtins.c index 3ed76892..1c4a8ca0 100644 --- a/psycopg/typecast_builtins.c +++ b/psycopg/typecast_builtins.c @@ -15,7 +15,7 @@ static long int typecast_BINARY_types[] = {17, 0}; static long int typecast_ROWID_types[] = {26, 0}; static long int typecast_LONGINTEGERARRAY_types[] = {1016, 0}; static long int typecast_INTEGERARRAY_types[] = {1005, 1006, 1007, 0}; -static long int typecast_FLOATARRAY_types[] = {1017, 1021, 1022, 0}; +static long int typecast_FLOATARRAY_types[] = {1021, 1022, 0}; static long int typecast_DECIMALARRAY_types[] = {1231, 0}; static long int typecast_UNICODEARRAY_types[] = {1002, 1003, 1009, 1014, 1015, 0}; static long int typecast_STRINGARRAY_types[] = {1002, 1003, 1009, 1014, 1015, 0}; diff --git a/tests/test_types_extras.py b/tests/test_types_extras.py index b64d27e8..3d0d5ed5 100755 --- a/tests/test_types_extras.py +++ b/tests/test_types_extras.py @@ -116,6 +116,11 @@ class TypesExtrasTests(ConnectingTestCase): except psycopg2.ProgrammingError, err: self.failUnless(str(err) == "can't adapt type 'Foo'") + def test_point_array(self): + # make sure a point array is never casted to a float array, + # see https://github.com/psycopg/psycopg2/issues/613 + s = self.execute("""SELECT '{"(1,2)","(3,4)"}' AS foo""") + self.failUnless(s == """{"(1,2)","(3,4)"}""") def skip_if_no_hstore(f): @wraps(f)