Re: Getting interval in seconds? - Mailing list pgsql-general

From Alex Pilosov
Subject Re: Getting interval in seconds?
Date
Msg-id Pine.BSO.4.10.10106102359150.17529-100000@spider.pilosoft.com
Whole thread Raw
In response to Re: Getting interval in seconds?  (Lincoln Yeoh <lyeoh@pop.jaring.my>)
List pgsql-general
On Sun, 10 Jun 2001, Lincoln Yeoh wrote:

> Thanks!
>
> Which is better/faster?
>
> select date_part('epoch',('now'::timestamp - somedate)::interval) from
> sometable;
>
> Or
>
> select extract (epoch from interval ('now'::timestamp - somedate)) from
> sometable;
Speedwise, I think its the same. _maybe_ the latter is faster, but I
wouldn't bet on it.

> Should I be using 'now'::timestamp or some function form of it?
No difference whether you use now() or 'now'::timestamp.

-alex



pgsql-general by date:

Previous
From: Lincoln Yeoh
Date:
Subject: Re: Getting interval in seconds?
Next
From: Bruce Momjian
Date:
Subject: Re: Yet another Postgresql article...