Re: definative way to place secs from epoc into timestamp

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Bret Hughes <bhughes(at)elevating(dot)com>
Cc: postgresql sql list <pgsql-sql(at)postgresql(dot)org>
Subject: Re: definative way to place secs from epoc into timestamp
Date: 2005-03-02 20:26:26
Message-ID: 13466.1109795186@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Bret Hughes <bhughes(at)elevating(dot)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

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message PFC 2005-03-02 21:45:38 Re: Postgres performance
Previous Message Bret Hughes 2005-03-02 20:07:46 Re: definative way to place secs from epoc into timestamp