Postgresql Create Replace Function In Python For Lists