| From: | Samuel Sieb <samuel(at)sieb(dot)net> |
|---|---|
| To: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
| Cc: | George Robinson II <george(dot)robinson(at)eurekabroadband(dot)com>, pgsql-general(at)postgresql(dot)org |
| Subject: | Re: Thanks and questions... |
| Date: | 2000-07-29 01:53:02 |
| Message-ID: | 20000728185302.E1065@gw.sieb.net |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-general |
On Fri, Jul 28, 2000 at 06:53:41PM -0400, Tom Lane wrote:
> George Robinson II <george(dot)robinson(at)eurekabroadband(dot)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.
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Tom Lane | 2000-07-29 03:43:40 | Re: Hopefully simple date conversion question |
| Previous Message | Jason C. Pion | 2000-07-28 23:00:32 | Hopefully simple date conversion question |