Postgresql Find Substring In Python