I have a table `person_updates` in postgresql with rows like:

```
| id | status | person_id | modified_at      |
|----|--------|-----------|------------------|
| 1  | INFO   | 2         | 2019-11-01 10:00 |
| 1  | UPDATE | 2         | 2019-11-02 15:00 |
| 1  | DEBUG  | 2         | 2019-11-03 12:00 |
| 3  | INFO   | 4         | 2019-11-04 14:00 |
| 3  | UPDATE | 4         | 2019-11-05 16:00 |
| 5  | INFO   | 6         | 2019-11-06 08:00 |
| 5  | DEBUG  | 6         | 2019-11-07 07:00 |

```

I want to get the INFO rows that are followed by an UPDATE row:

```
| id | status | person_id | modified_at      |
|----|--------|-----------|------------------|
| 1  | INFO   | 2         | 2019-11-01 10:00 |
| 3  | INFO   | 4         | 2019-11-04 14:00 |

```

I've attempted this by doing a lead query

```
select d2.id, d2.status, d2.modified_at, d2.person_id,
lead(d2.status) over (partition by d2.id order by d2.modified_at) as next_status
from person_updates d2
where d2.status = 'INFO'

```

This returns more rows than I want. Adding a `and d2.next_status = 'UPDATE'` throws an error. How do I do this query?