Re: problem with unixtime conversion

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Nathan Suderman" <nathan(at)pollstar(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: problem with unixtime conversion
Date: 2003-01-14 18:19:03
Message-ID: 17382.1042568343@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

"Nathan Suderman" <nathan(at)pollstar(dot)com> writes:
> test=> select date(date_part('epoch','now'::date)::int);
> ERROR: Bad date external representation '1042502400'

I think your code was relying on the int->abstime coercion, which was
implicitly invokable before 7.3, but now has to be specified explicitly.

regression=# select date(date_part('epoch','now'::date)::int::abstime);
date
------------
2003-01-13
(1 row)

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Ben 2003-01-14 18:19:47 Re: problem with unixtime conversion
Previous Message Stephan Szabo 2003-01-14 18:11:17 Re: Server error and deadlocks