Skip site navigation (1) Skip section navigation (2)

Re: Trouble with UNIX TimeStamps

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: jchum(at)aismedia(dot)com
Cc: "'Bruno Wolff III'" <bruno(at)wolff(dot)to>,pgsql-general(at)postgresql(dot)org
Subject: Re: Trouble with UNIX TimeStamps
Date: 2002-12-27 18:39:58
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-general
"Jonathan Chum" <jchum(at)aismedia(dot)com> writes:
> ERROR:  Cannot cast type integer to timestamp with time zone

A solution with less notational cruft is to cast the integer to abstime:

regression=# select 1040999196::abstime;
 2002-12-27 09:26:36-05
(1 row)

regression=# select to_char(1040999196::abstime, 'Day');
(1 row)

abstime is a deprecated datatype if you believe the manual, but I
seriously doubt that we'll remove it anytime soon.  Maybe when Y2038
is upon us (by which time you'd better have found another representation
for your table, anyway).

			regards, tom lane

In response to

pgsql-general by date

Next:From: Bruce MomjianDate: 2002-12-27 18:51:04
Subject: Re: Storing passwords
Previous:From: BenDate: 2002-12-27 18:32:29
Subject: Re: Trouble with UNIX TimeStamps

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group