Anyone interested in arrays and plpython might find this interesting.
Based on the conversation below I put these functions in a library
(pg_stuff.py):
def arr2list(a):
a = a.replace("{","[").replace("}","]")
pylist = eval(a)
return pylist
def list2arr(a):
parm = `a`
parm=parm
I ran into an interesting issue trying to pass an array to a plpythonu function
(Postgresql 8.03).
When I googled the issue I found a number of people asking similar questions and they haven't found
an answer. The problem is that there is no type mapped from a postgresql array to a python list.