Re: Thanks and questions... - Mailing list pgsql-general

From Samuel Sieb
Subject Re: Thanks and questions...
Date
Msg-id 20000728185302.E1065@gw.sieb.net
Whole thread Raw
In response to Re: Thanks and questions...  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
On Fri, Jul 28, 2000 at 06:53:41PM -0400, Tom Lane wrote:
> George Robinson II <george.robinson@eurekabroadband.com> writes:
> >     What approach would be the most efficient way to accomplish this goal?
> > With what language or tools would you recommend?  If I were to leave the
> > time as a int4, epoch time, what would the select look like to return
> > other time formats?
>
> Presently the easiest way to get from Unix time to a stored timestamp
> datum is to coerce to abstime first.
>
> regression=# insert into foo values(abstime(964824656));
>
> I don't think this'd work in the context of a COPY command,
> unfortunately, but it works fine in an INSERT.
>
>             regards, tom lane

Would it maybe be easier to store in the table as int4, then coerce on the
way out.  That way you could use copy.


pgsql-general by date:

Previous
From: "Jason C. Pion"
Date:
Subject: Hopefully simple date conversion question
Next
From: Tom Lane
Date:
Subject: Re: Hopefully simple date conversion question