Postgres User Defined Functions In Python