Postgresql – Which field type is better to store specific play time in video for postgres?

database-designpostgresql

Friend and I are making video service.

In video table, we store opening start point and opening end point of each video. For example,

opening start time: 00:01:35

opening end time: 00:03:04

At first, I made each column with time(6) type. But my friend told me each column should be interval type.

So in following case, which is better?

1) Each column is time(6) type.

2) Each column is interval type.

3) opening start time column is time(6) type, and opening elasped time is interval type

Best Answer

Time is for representing time of day

Interval is for representing durations

Interval is probably the best fit for locating instants inside a video recording, but an integer or bigint count of frame number is another candidate.