Postgres Find String Method In Python For All Selected Lines