Re: EPOCH TIMESTAMP Conversion Problem

From: Louis-David Mitterrand <vindex+lists-pgsql-sql(at)apartia(dot)org>
To: pgsql-sql(at)postgresql(dot)org
Subject: Re: EPOCH TIMESTAMP Conversion Problem
Date: 2008-01-01 14:28:37
Message-ID: 20080101142837.GA24772@apartia.fr
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

On Wed, Nov 07, 2007 at 10:35:08AM -0500, Tom Lane wrote:
> "Amitanand Chikorde" <amit99rs(at)gmail(dot)com> writes:
> > I want to convert MAX(mydate) from myTable to Epoch.
>
> Do you mean
> SELECT EXTRACT(EPOCH FROM MAX(mydate)) FROM myTable

Is using casts for the same purpose deprecated?

SELECT current_date::timestamp::abstime::int4;

Or less efficient?

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Tom Lane 2008-01-01 19:03:48 Re: EPOCH TIMESTAMP Conversion Problem
Previous Message Mario Becroft 2008-01-01 07:40:09 Re: Using rules to implement backward-compatible schema changes