Postgres Execute Function Python Practice