With **PostgreSQL 13.6** have a table of multiple GPS points already group by `track_id` (HEX number not sequential), and from where `ST_Makeline` is made to build a line. Some of these tracks have a time gap between them bigger than a given value (say 10 minutes). Need to split the `track_id` where these gaps exits, to a `track_id` (before 1st gap) and `track_id+1` (after 1st gap) ... `track_id+n` (after n_st gap). the `track_id` is a non-sequential large intervals HEX number, so no issues on adding a few additional units (1 to 2 gaps per track) to it. The actual location `geom` is irrelevant in the analysis, since the points in the gap can be close (time spent on same position) or far apart (loose of reception). This is only to clean and organize data, before any further analysis. table example: | track_id | geom| time| |--|--|--| |123| aaaa | 10:01| |123| aaab | 10:02| |123| aaac | 10:05| |123| aaad | 10:45| |123| aaae | 10:47| |123| aaaf | 10:49| |234| aaab | 10:52| |234| aaac | 10:55| |234| aaaa | 10:58| to build, new column 'new_track_id`: | track_id | geom| time|new_track_id| |--|--|--|--| |123| aaaa | 10:01| 123 |123| aaab | 10:02| 123 |123| aaac | 10:05| 123 |123| aaad | 10:45| 124 |123| aaae | 10:47|124 |123| aaaf | 10:49| 124 |234| aaab | 10:52| 234 |234| aaac | 10:55| 234 |234| aaaa | 10:58| 234