Postgresql Check If Value Contains Method In Python