Re: definative way to place secs from epoc into timestamp - Mailing list pgsql-sql

From Tom Lane
Subject Re: definative way to place secs from epoc into timestamp
Date
Msg-id 13466.1109795186@sss.pgh.pa.us
Whole thread Raw
In response to Re: definative way to place secs from epoc into timestamp  (Bret Hughes <bhughes@elevating.com>)
Responses Re: definative way to place secs from epoc into timestamp
List pgsql-sql
Bret Hughes <bhughes@elevating.com> writes:
> Thanks for the feed back tom  I say that but I could not believe that I
> have to jump through all those hoops on an insert or update

> update mytable set (lasttime =(SELECT TIMESTAMP WITH TIME ZONE 'epoch' +
> 982384720 * INTERVAL '1 second') )

> is this what you are saying I need to do?

You can make a function that embodies whichever semantics you want.

> also, what is happening with abstime(982384720)?  this works as expected
> (by me ).  Is this a bad idea?

It won't be there forever.
        regards, tom lane


pgsql-sql by date:

Previous
From: Bret Hughes
Date:
Subject: Re: definative way to place secs from epoc into timestamp
Next
From: PFC
Date:
Subject: Re: Postgres performance