This does change the behavior of any existing functions that return a domain over array. For example:
postgres=# create domain intarr as integer[]; CREATE DOMAIN postgres=# create function intarr_test() returns intarr as $$ return '{1,2}' $$ language plpythonu; CREATE FUNCTION
postgres=# select intarr_test(); ERROR: invalid input syntax for integer: "{" CONTEXT: while creating return value PL/Python function "intarr_test"
The new behavior is clearly better, but it is an incompatibility nonetheless. I don't do anything with PL/python myself, so I don't have a good feel of how much that'll break people's applications. Probably not much I guess. But warrants a mention in the release notes at least. Any thoughts on that?
- Heikki
Bear in mind that the same goes for receiving domains over arrays as parameters; instead of seeing a string (previous behavior), with this patch a function will see a list from the Python side (the function implementation). A mention in the release notes is in order, I agree with that.
I can't speak for other people, but I guess using domains over arrays as parameters and/or return values in plpythonu functions should be rare, considering the current behavior and especially given the possibility of using a regular array in order to handle array values a lists in Python.