timezone_hour missing

Started by Kari Lempiainenabout 23 years ago4 messagesgeneral
Jump to latest
#1Kari Lempiainen
kari@funky.pp.fi

What has happened to timezone_hour? Never used it before, but I could
use it now...

temperature=# select version();
version
---------------------------------------------------------------------
PostgreSQL 7.3.2 on i686-pc-linux-gnu, compiled by GCC egcs-2.91.66
(1 row)

Time: 1,91 ms
temperature=# select extract(timezone_hour from timestamp '2001-10-10
01:04:54.965162+03');
ERROR: TIMESTAMP units 'timezone_hour' not supported

Cheers,

Kari Lempiainen

#2Olleg Samojlov
olleg@telecom.mipt.ru
In reply to: Kari Lempiainen (#1)
Re: timezone_hour missing

Kari Lempiainen wrote:

temperature=# select version();
version
---------------------------------------------------------------------
PostgreSQL 7.3.2 on i686-pc-linux-gnu, compiled by GCC egcs-2.91.66
(1 row)

Time: 1,91 ms
temperature=# select extract(timezone_hour from timestamp '2001-10-10
01:04:54.965162+03');
ERROR: TIMESTAMP units 'timezone_hour' not supported

Try:

template1=# select extract(timezone_hour from timestamp with time zone
'2001-10-10 01:04:54.965162+03');
date_part
-----------
-4
(1 row)

--
Olleg Samoylov

#3Kari Lempiainen
kari@funky.pp.fi
In reply to: Kari Lempiainen (#1)
Re: timezone_hour missing

Oleg Samoylov <olleg@telecom.mipt.ru> wrote:

Try:

template1=# select extract(timezone_hour from timestamp with time zone
'2001-10-10 01:04:54.965162+03');
date_part
-----------
-4
(1 row)

Did tre trick. Thanks!!

Kari

#4Tom Lane
tgl@sss.pgh.pa.us
In reply to: Kari Lempiainen (#1)
Re: timezone_hour missing

Kari Lempiainen <kari@funky.pp.fi> writes:

temperature=# select extract(timezone_hour from timestamp '2001-10-10
01:04:54.965162+03');
ERROR: TIMESTAMP units 'timezone_hour' not supported

"timestamp" doesn't contain a timezone. Use "timestamp with time zone".

regards, tom lane