Postgresql Find Substring Python Function Parameters