diff options
Diffstat (limited to 'src/pl/plpython/expected')
| -rw-r--r-- | src/pl/plpython/expected/plpython_types.out | 28 | ||||
| -rw-r--r-- | src/pl/plpython/expected/plpython_types_3.out | 28 |
2 files changed, 56 insertions, 0 deletions
diff --git a/src/pl/plpython/expected/plpython_types.out b/src/pl/plpython/expected/plpython_types.out index 91106e04550..785ffca9cd8 100644 --- a/src/pl/plpython/expected/plpython_types.out +++ b/src/pl/plpython/expected/plpython_types.out @@ -664,6 +664,34 @@ SELECT * FROM test_type_conversion_array_error(); ERROR: return value of function with array return type is not a Python sequence CONTEXT: while creating return value PL/Python function "test_type_conversion_array_error" +CREATE DOMAIN ordered_pair_domain AS integer[] CHECK (array_length(VALUE,1)=2 AND VALUE[1] < VALUE[2]); +CREATE FUNCTION test_type_conversion_array_domain(x ordered_pair_domain) RETURNS ordered_pair_domain AS $$ +plpy.info(x, type(x)) +return x +$$ LANGUAGE plpythonu; +SELECT * FROM test_type_conversion_array_domain(ARRAY[0, 100]::ordered_pair_domain); +INFO: ([0, 100], <type 'list'>) +CONTEXT: PL/Python function "test_type_conversion_array_domain" + test_type_conversion_array_domain +----------------------------------- + {0,100} +(1 row) + +SELECT * FROM test_type_conversion_array_domain(NULL::ordered_pair_domain); +INFO: (None, <type 'NoneType'>) +CONTEXT: PL/Python function "test_type_conversion_array_domain" + test_type_conversion_array_domain +----------------------------------- + +(1 row) + +CREATE FUNCTION test_type_conversion_array_domain_check_violation() RETURNS ordered_pair_domain AS $$ +return [2,1] +$$ LANGUAGE plpythonu; +SELECT * FROM test_type_conversion_array_domain_check_violation(); +ERROR: value for domain ordered_pair_domain violates check constraint "ordered_pair_domain_check" +CONTEXT: while creating return value +PL/Python function "test_type_conversion_array_domain_check_violation" --- --- Composite types --- diff --git a/src/pl/plpython/expected/plpython_types_3.out b/src/pl/plpython/expected/plpython_types_3.out index 523c2ecda23..25331f268a1 100644 --- a/src/pl/plpython/expected/plpython_types_3.out +++ b/src/pl/plpython/expected/plpython_types_3.out @@ -664,6 +664,34 @@ SELECT * FROM test_type_conversion_array_error(); ERROR: return value of function with array return type is not a Python sequence CONTEXT: while creating return value PL/Python function "test_type_conversion_array_error" +CREATE DOMAIN ordered_pair_domain AS integer[] CHECK (array_length(VALUE,1)=2 AND VALUE[1] < VALUE[2]); +CREATE FUNCTION test_type_conversion_array_domain(x ordered_pair_domain) RETURNS ordered_pair_domain AS $$ +plpy.info(x, type(x)) +return x +$$ LANGUAGE plpython3u; +SELECT * FROM test_type_conversion_array_domain(ARRAY[0, 100]::ordered_pair_domain); +INFO: ([0, 100], <class 'list'>) +CONTEXT: PL/Python function "test_type_conversion_array_domain" + test_type_conversion_array_domain +----------------------------------- + {0,100} +(1 row) + +SELECT * FROM test_type_conversion_array_domain(NULL::ordered_pair_domain); +INFO: (None, <class 'NoneType'>) +CONTEXT: PL/Python function "test_type_conversion_array_domain" + test_type_conversion_array_domain +----------------------------------- + +(1 row) + +CREATE FUNCTION test_type_conversion_array_domain_check_violation() RETURNS ordered_pair_domain AS $$ +return [2,1] +$$ LANGUAGE plpython3u; +SELECT * FROM test_type_conversion_array_domain_check_violation(); +ERROR: value for domain ordered_pair_domain violates check constraint "ordered_pair_domain_check" +CONTEXT: while creating return value +PL/Python function "test_type_conversion_array_domain_check_violation" --- --- Composite types --- |
