| From: | Louis-David Mitterrand <vindex+lists-pgsql-general(at)apartia(dot)org> |
|---|---|
| To: | pgsql-general(at)postgresql(dot)org |
| Subject: | Re: postgres UTC different from perl? |
| Date: | 2007-12-23 16:38:45 |
| Message-ID: | 20071223163845.GB6472@apartia.fr |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-general |
On Wed, Dec 19, 2007 at 08:14:17PM -0500, Tom Lane wrote:
> Richard Huxton <dev(at)archonet(dot)com> writes:
> > I'm not sure that (CURRENT_DATE AT TIME ZONE 'UTC') does what you think
> > it does. Try setting your timezone to various offsets and exploring.
>
> In fact, I think it's adjusting in exactly the wrong direction.
>
> I get the right number from
>
> regression=# select date_part('epoch', 'today'::timestamp at time zone 'UTC');
> date_part
> ------------
> 1198022400
> (1 row)
>
> and the wrong one from
>
> regression=# select date_part('epoch', 'today'::timestamptz at time zone 'UTC');
> date_part
> ------------
> 1198058400
> (1 row)
>
> and I think the locution with CURRENT_DATE is equivalent to the second
> case because timestamptz is the preferred type to promote date to.
Does that mean it's a postgresql bug?
| From | Date | Subject | |
|---|---|---|---|
| Next Message | brian | 2007-12-23 16:45:08 | Re: pgsql cannot read utf8 files moved from windows correctly! |
| Previous Message | Martin Gainty | 2007-12-23 16:00:52 | Re: pgsql cannot read utf8 files moved from windows correctly! |