Re: CAST INTERVAL to INT??

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: listuser(at)peternixon(dot)net
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: CAST INTERVAL to INT??
Date: 2003-07-31 21:43:10
Message-ID: 19495.1059687790@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Peter Nixon <listuser(at)peternixon(dot)net> writes:
> I am trying to cast a INTERVAL to an INT (or BIGINT) without much success.

"extract(epoch from <interval>)" will produce the interval's value in
seconds ... as a float8, but you can cast that to bigint ...

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Robert Treat 2003-07-31 21:59:37 Re: surppressing column names in COPY format
Previous Message Tom Lane 2003-07-31 21:21:59 Re: surppressing column names in COPY format