Q:

PostgreSQL get time difference between two text fields

I have two fields in table like
Time1(varchar)     Time2(varchar)
13:01:15           14:02:06

How do I get the time difference between these two fields? 

A:

You can cast the values to a proper time value, then simply subtract them: 
'14:02:06'::time - '13:01:15'::time 

or
time_2::time - time_1::time

The result is an interval

