Say I have an interval like
4 days 10:00:00
in postgres. How do I convert that to a number of hours (106 in this case?) Is there a function
If you convert table field:
Define the field so it contains seconds:
CREATE TABLE IF NOT EXISTS test ( ... field INTERVAL SECOND(0) );
Extract the value. Remember to cast to int other wise you can get an unpleasant surprise once the intervals are big:
EXTRACT(EPOCH FROM field)::int