Add a regression test case for bug #5497
This commit is contained in:
parent
bc325d8432
commit
6b72aa5154
@ -528,6 +528,18 @@ SELECT * FROM test_type_conversion_array_int4(ARRAY[[1,2,3],[4,5,6]]);
|
|||||||
ERROR: cannot convert multidimensional array to Python list
|
ERROR: cannot convert multidimensional array to Python list
|
||||||
DETAIL: PL/Python only supports one-dimensional arrays.
|
DETAIL: PL/Python only supports one-dimensional arrays.
|
||||||
CONTEXT: PL/Python function "test_type_conversion_array_int4"
|
CONTEXT: PL/Python function "test_type_conversion_array_int4"
|
||||||
|
CREATE FUNCTION test_type_conversion_array_text(x text[]) RETURNS text[] AS $$
|
||||||
|
plpy.info(x, type(x))
|
||||||
|
return x
|
||||||
|
$$ LANGUAGE plpythonu;
|
||||||
|
SELECT * FROM test_type_conversion_array_text(ARRAY['foo', 'bar']);
|
||||||
|
INFO: (['foo', 'bar'], <type 'list'>)
|
||||||
|
CONTEXT: PL/Python function "test_type_conversion_array_text"
|
||||||
|
test_type_conversion_array_text
|
||||||
|
---------------------------------
|
||||||
|
{foo,bar}
|
||||||
|
(1 row)
|
||||||
|
|
||||||
CREATE FUNCTION test_type_conversion_array_bytea(x bytea[]) RETURNS bytea[] AS $$
|
CREATE FUNCTION test_type_conversion_array_bytea(x bytea[]) RETURNS bytea[] AS $$
|
||||||
plpy.info(x, type(x))
|
plpy.info(x, type(x))
|
||||||
return x
|
return x
|
||||||
|
@ -528,6 +528,18 @@ SELECT * FROM test_type_conversion_array_int4(ARRAY[[1,2,3],[4,5,6]]);
|
|||||||
ERROR: cannot convert multidimensional array to Python list
|
ERROR: cannot convert multidimensional array to Python list
|
||||||
DETAIL: PL/Python only supports one-dimensional arrays.
|
DETAIL: PL/Python only supports one-dimensional arrays.
|
||||||
CONTEXT: PL/Python function "test_type_conversion_array_int4"
|
CONTEXT: PL/Python function "test_type_conversion_array_int4"
|
||||||
|
CREATE FUNCTION test_type_conversion_array_text(x text[]) RETURNS text[] AS $$
|
||||||
|
plpy.info(x, type(x))
|
||||||
|
return x
|
||||||
|
$$ LANGUAGE plpython3u;
|
||||||
|
SELECT * FROM test_type_conversion_array_text(ARRAY['foo', 'bar']);
|
||||||
|
INFO: (['foo', 'bar'], <class 'list'>)
|
||||||
|
CONTEXT: PL/Python function "test_type_conversion_array_text"
|
||||||
|
test_type_conversion_array_text
|
||||||
|
---------------------------------
|
||||||
|
{foo,bar}
|
||||||
|
(1 row)
|
||||||
|
|
||||||
CREATE FUNCTION test_type_conversion_array_bytea(x bytea[]) RETURNS bytea[] AS $$
|
CREATE FUNCTION test_type_conversion_array_bytea(x bytea[]) RETURNS bytea[] AS $$
|
||||||
plpy.info(x, type(x))
|
plpy.info(x, type(x))
|
||||||
return x
|
return x
|
||||||
|
@ -223,6 +223,14 @@ SELECT * FROM test_type_conversion_array_int4(NULL);
|
|||||||
SELECT * FROM test_type_conversion_array_int4(ARRAY[[1,2,3],[4,5,6]]);
|
SELECT * FROM test_type_conversion_array_int4(ARRAY[[1,2,3],[4,5,6]]);
|
||||||
|
|
||||||
|
|
||||||
|
CREATE FUNCTION test_type_conversion_array_text(x text[]) RETURNS text[] AS $$
|
||||||
|
plpy.info(x, type(x))
|
||||||
|
return x
|
||||||
|
$$ LANGUAGE plpythonu;
|
||||||
|
|
||||||
|
SELECT * FROM test_type_conversion_array_text(ARRAY['foo', 'bar']);
|
||||||
|
|
||||||
|
|
||||||
CREATE FUNCTION test_type_conversion_array_bytea(x bytea[]) RETURNS bytea[] AS $$
|
CREATE FUNCTION test_type_conversion_array_bytea(x bytea[]) RETURNS bytea[] AS $$
|
||||||
plpy.info(x, type(x))
|
plpy.info(x, type(x))
|
||||||
return x
|
return x
|
||||||
|
Loading…
x
Reference in New Issue
Block a user