date_part bug?

From: Tim Williams <williams(at)ugsolutions(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: date_part bug?
Date: 1998-12-17 18:00:41
Message-ID: 367946C9.A9A8D3D6@ugsolutions.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Greetings,

When I run the following set of statements in postgres v6.4 (built on
Debian Linux):

create table tmp (v1 date, v2 datetime);
insert into tmp values ('06-01-1999', '06-01-1999');
select date_part('month', v1) as m1, date_part('month', v2) as m2 from
tmp;

I see the following results:

m1|m2
--+--
5| 6
(1 row)

Why is date_part giving different results for date and date_time? Why
is it wrong for 'date'? Anybody seen this before?

Thanks much in advance,
- Tim

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Gregory Maxwell 1998-12-17 19:59:23 Re: [GENERAL] Why PostgreSQL is better than other commerial softwares?
Previous Message Hal Snyder 1998-12-17 17:10:04 Re: [GENERAL] Why PostgreSQL is better than other commerial softwares?