Int to Interval conversion

From: Howard Cole <howardnews(at)selestial(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Int to Interval conversion
Date: 2010-09-14 11:57:46
Message-ID: 4C8F633A.7070906@selestial.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi everyone,

I have a table with a duration field, stored as an Integer. How can I
retrieve this from the table as an Interval type?

E.g.

create table test (test_id serial primary key, time_in_minutes int);
insert into test values (1440);

Now how do I extract that as 24:00:00::interval in a query?

Thanks.

Howard Cole.

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Bill Moran 2010-09-14 12:35:28 Re: What filesystem to use for postgres?
Previous Message Michele Petrazzo - Unipex 2010-09-14 11:25:53 Re: Replacing characters in a string