Re: BUG #12460: Extracting epoch from timestamp string incorrectly assumes "with time zone"

From: David G Johnston <david(dot)g(dot)johnston(at)gmail(dot)com>
To: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #12460: Extracting epoch from timestamp string incorrectly assumes "with time zone"
Date: 2015-01-08 04:51:22
Message-ID: 1420692682829-5833277.post@n5.nabble.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

adeconsulting wrote
> The following bug has been logged on the website:
>
> Bug reference: 12460
> Logged by: Alan Edel
> Email address:

> adeconsulting@

> PostgreSQL version: 9.3.5
> Operating system: FreeBSD 9.3
> Description:
>
> 8.3.6 queries using "timestamp" and "timestamptz" casting both give the
> same
> result:
>
> select extract(epoch from cast('2015/01/07 14:00:00' as timestamp));
> date_part
> ------------
> 1420668000
> (1 row)
>
> select extract(epoch from cast('2015/01/07 14:00:00' as timestamptz));
> date_part
> ------------
> 1420668000
> (1 row)
>
> However, 9.3.5 gives different results, the first one appears to be
> incorrect:
>
> select extract(epoch from cast('2015/01/07 14:00:00' as timestamp));
> date_part
> ------------
> 1420639200
> (1 row)
>
> select extract(epoch from cast('2015/01/07 14:00:00' as timestamptz));
> date_part
> ------------
> 1420668000
> (1 row)

Intentional behavior change in 9.2

http://www.postgresql.org/docs/9.2/interactive/release-9-2.html

David J.

--
View this message in context: http://postgresql.nabble.com/BUG-12460-Extracting-epoch-from-timestamp-string-incorrectly-assumes-with-time-zone-tp5833256p5833277.html
Sent from the PostgreSQL - bugs mailing list archive at Nabble.com.

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message mingli 2015-01-08 07:27:55 How to init a new BuildFarm Server on my linux system
Previous Message adeconsulting 2015-01-08 00:44:00 BUG #12460: Extracting epoch from timestamp string incorrectly assumes "with time zone"