extract and time zones

From: Oscar Estevez Lopez <oestevez(at)prisacom(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: extract and time zones
Date: 2003-08-01 11:39:59
Message-ID: 20030801133959.2f1d1283.oestevez@prisacom.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-general

Um, and what about this?

$ uname -a
FreeBSD caneli 4.7-RELEASE FreeBSD 4.7-RELEASE #1: Fri May 9 02:30:11 CEST 2003 root(at)caneli:/usr/obj/usr/src/sys/CANELI i386

$ psql --version
psql (PostgreSQL) 7.2.2
contains support for: readline, history, multibyte
Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
Portions Copyright (c) 1996, Regents of the University of California
Read the file COPYRIGHT or use the command \copyright to see the
usage and distribution terms.

create table t1( d timestamp(0) without time zone );
CREATE

insert into t1 values( current_timestamp );
INSERT 26251 1

select * from t1;
d
---------------------
2003-08-01 13:30:38
(1 row)

select extract( epoch from d ) from t1;
date_part
------------
1059744638
(1 row)

select extract( epoch from d::timestamp ) from t1;
date_part
------------
1059737438
(1 row)

d : 1059744638
d::timestamp : 1059737438

??

Does 'epoch from d' check time zone and 'epoch from d::timestamp' doesn't?

--

________________________________________________________
One ping to rule them all, one ping to find them,
one ping to bring them all and in the darkness bind them.
(Lord of the windows)

============================================================================
This e-mail message and any attached files are intended SOLELY for the addressee/s identified herein. It may contain CONFIDENTIAL and/or LEGALLY PRIVILEGED information and may not necessarily represent the opinion of this company. If you receive this message in ERROR, please immediately notify the sender and DELETE it since you ARE NOT AUTHORIZED to use, disclose, distribute, print or copy all or part of the contained information. Thank you.
============================================================================

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2003-08-01 14:41:22 Re: casting timeofday() to timestamp boken under cygwin - Problem identified
Previous Message Tom Lane 2003-08-01 05:02:24 Re: PostgreSQL 7.3.3 with pgcrypto on FreeBSD 5.1

Browse pgsql-general by date

  From Date Subject
Next Message Peter Eisentraut 2003-08-01 11:47:48 Re: Error from Sub-Select, Simple Example.
Previous Message Dave Cramer 2003-08-01 09:55:31 Re: surppressing column names in COPY format