dbTalk Databases Forums  

[BUGS] BUG #1094: date_part('week') bug

mailing.database.pgsql-bugs mailing.database.pgsql-bugs


Discuss [BUGS] BUG #1094: date_part('week') bug in the mailing.database.pgsql-bugs forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
PostgreSQL Bugs List
 
Posts: n/a

Default [BUGS] BUG #1094: date_part('week') bug - 03-04-2004 , 12:03 PM







The following bug has been logged online:

Bug reference: 1094
Logged by: xterm

Email address: xterm (AT) linuxnews (DOT) pl

PostgreSQL version: 7.3.4

Operating system: RH Fedora

Description: date_part('week') bug

Details:

Some late dates give in some years wrong
date_part('week')

examples:

select date_part('week', '2003-12-30'::date);
date_part
-----------
1
(1 row)

select date_part('week', '1997-12-29'::date);
date_part
-----------
1
(1 row)

but:

select date_part('week', '1998-12-31'::date);
date_part
-----------
53
(1 row)




---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster

Reply With Quote
  #2  
Old   
Bruno Wolff III
 
Posts: n/a

Default Re: [BUGS] BUG #1094: date_part('week') bug - 03-04-2004 , 12:11 PM






On Thu, Mar 04, 2004 at 13:56:42 -0400,
PostgreSQL Bugs List <pgsql-bugs (AT) postgresql (DOT) org> wrote:
Quote:
The following bug has been logged online:
This isn't a bug. Weeks that span years are treated as part of the year
in which Thursday of that week lies.

Quote:
Bug reference: 1094
Logged by: xterm

Email address: xterm (AT) linuxnews (DOT) pl

PostgreSQL version: 7.3.4

Operating system: RH Fedora

Description: date_part('week') bug

Details:

Some late dates give in some years wrong
date_part('week')

examples:

select date_part('week', '2003-12-30'::date);
date_part
-----------
1
(1 row)

select date_part('week', '1997-12-29'::date);
date_part
-----------
1
(1 row)

but:

select date_part('week', '1998-12-31'::date);
date_part
-----------
53
(1 row)




---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster
---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://archives.postgresql.org


Reply With Quote
  #3  
Old   
Robert Creager
 
Posts: n/a

Default Re: [BUGS] BUG #1094: date_part('week') bug - 03-04-2004 , 09:50 PM



--Multipart_Thu__4_Mar_2004_20_46_19_-0700_=.xwOk6Er1v(HhYE
Content-Type: text/plain; charset=US-ASCII
Content-Disposition: inline
Content-Transfer-Encoding: 7bit

When grilled further on (Thu, 4 Mar 2004 13:56:42 -0400 (AST)),
"PostgreSQL Bugs List" <pgsql-bugs (AT) postgresql (DOT) org> confessed:

Quote:
Some late dates give in some years wrong
date_part('week')

examples:

select date_part('week', '2003-12-30'::date);
date_part
-----------
1
(1 row)
If you read the documentation on the function date_part 'week', you'll
understand that this is the correct behavior, not a bug.

Later,
Rob

--
20:42:47 up 19 days, 4:20, 2 users, load average: 2.07, 2.14, 2.11
Linux 2.4.21-0.13_test #60 SMP Sun Dec 7 17:00:02 MST 2003

--Multipart_Thu__4_Mar_2004_20_46_19_-0700_=.xwOk6Er1v(HhYE
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.2 (GNU/Linux)

iEYEARECAAYFAkBH+BIACgkQLQ/DKuwDYzlWlgCdHZtPyGme1UDaNQa2cPa4IkoA
E04Aniq5VGab/H3PJx6dFtF8srM6CGhl
=tuD7
-----END PGP SIGNATURE-----

--Multipart_Thu__4_Mar_2004_20_46_19_-0700_=.xwOk6Er1v(HhYE--



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.