The function only ever returns one result of which only the place_id is used. So simplify it to return a single place_id only (or NULL if none is found). Rename funciton to avoid conflicts when updating an existing database.