Re: Another date / time question - Mailing list pgsql-general

From Tom Lane
Subject Re: Another date / time question
Date
Msg-id 25059.1080321719@sss.pgh.pa.us
Whole thread Raw
In response to Another date / time question  ("Vanole, Mike" <mike.vanole@attws.com>)
Responses Re: Another date / time question
List pgsql-general
"Vanole, Mike" <mike.vanole@attws.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

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: pg_dump is missing data
Next
From: "Guy Rouillier"
Date:
Subject: Physical Database Configuration