pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
BUG #12460: Extracting epoch from timestamp string incorrectly assumes "with time zone"
2+ messages / 2 participants
[nested] [flat]

* BUG #12460: Extracting epoch from timestamp string incorrectly assumes "with time zone"
@ 2015-01-08 00:44  adeconsulting@pacbell.net
  0 siblings, 1 reply; 2+ messages in thread

From: adeconsulting@pacbell.net @ 2015-01-08 00:44 UTC (permalink / raw)
  To: pgsql-bugs

The following bug has been logged on the website:

Bug reference:      12460
Logged by:          Alan Edel
Email address:      adeconsulting@pacbell.net
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)



-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs



^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: BUG #12460: Extracting epoch from timestamp string incorrectly assumes "with time zone"
@ 2015-01-08 04:51  David G Johnston <david.g.johnston@gmail.com>
  parent: adeconsulting@pacbell.net
  0 siblings, 0 replies; 2+ messages in thread

From: David G Johnston @ 2015-01-08 04:51 UTC (permalink / raw)
  To: 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-wi...
Sent from the PostgreSQL - bugs mailing list archive at Nabble.com.


-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs



^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2015-01-08 04:51 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2015-01-08 00:44 BUG #12460: Extracting epoch from timestamp string incorrectly assumes "with time zone" adeconsulting@pacbell.net
2015-01-08 04:51 ` David G Johnston <david.g.johnston@gmail.com>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox