Python Dynamic Create Function In Postgresql