You can add event information (events) to a trajectory to record additional information about the entire trajectory.
Scenario example:
For example, for the trajectory of a delivery truck, you can record events such as refueling, loading, and unloading along the route. Unlike attribute information, not every trajectory sampling point carries event information, and the time when an event occurs does not necessarily align with a trajectory sampling point.
You can use the ST_AddEvent function to add event information to a trajectory.
For example, the truck of the user whose USERID is 1 was refueled at 17:45:00. If you define the event ID for refueling as 1001, you can add this event to the trajectory. SQL example:
UPDATE trajectory_table
SET traj = ST_AddEvent(traj, 1001, '2020-04-11 17:45:00') WHERE userid = 1;