postgresql – Postgres group records by consecutive types


I would like to group objects by their consecutive start and end date.

+----------+----------------------------+
|  Fruit   | Time                       |
+----------+----------------------------+
| Apple    | 2020-09-08 00:00:00.000000 | 
| Apple    | 2020-09-08 01:00:00.000000 | 
| Orange   | 2020-09-08 02:00:00.000000 | 
| Orange   | 2020-09-08 03:00:00.000000 | 
| Apple    | 2020-09-08 04:00:00.000000 | 
+----------+---------------+------------+

The results should look like this:

+----------+----------------------------+----------------------------+
|  Fruit   | Start Time                 | End Time                   |
+----------+----------------------------+----------------------------+
| Apple    | 2020-09-08 00:00:00.000000 | 2020-09-08 01:00:00.000000 |
| Orange   | 2020-09-08 02:00:00.000000 | 2020-09-08 03:00:00.000000 |
| Apple    | 2020-09-08 04:00:00.000000 | 2020-09-08 04:00:00.000000 |
+----------+----------------------------+----------------------------+