Re: Another date / time question

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Vanole, Mike" <mike(dot)vanole(at)attws(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Another date / time question
Date: 2004-03-26 17:21:59
Message-ID: 25059.1080321719@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

"Vanole, Mike" <mike(dot)vanole(at)attws(dot)com> writes:
> I'm trying to query two timestamp(0) columns to determine elapsed time. I u=
> se the age() function which works fine, but I want to return the informatio=
> n in MINUTES.=20

Just subtract (giving an interval), use extract(epoch) to get the
interval in seconds, then divide by 60 and round (or truncate if you
prefer).

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2004-03-26 17:23:46 Re: pg_dump is missing data
Previous Message Ron St-Pierre 2004-03-26 16:51:26 Re: \s paging?