Postgresql Boolean Functions Python Definition