Postgres Flatten Array Python Declarations