You can add events to a trajectory to record additional information about the trajectory.

Sample scenarios:

For example, you can record data about the refueling, loading, and unloading in the trajectory of a truck. Events may not occur at some sampling points, and an event may occur at a point in time that is not included in the sampling points of the trajectory. These are different from attribute information.

To add an event, you can use the ST_AddEvent function.

For example, the truck of the user whose userid is 1 was refueled at 17:45:00. You can define the ID of the refueling event as 1001 and add this event to the trajectory. Sample SQL statements:
UPDATE trajectory_table
SET traj = ST_AddEvent(traj, 1001, '2020-04-11 17:45:00') WHERE userid = 1;