Skip site navigation (1) Skip section navigation (2)

Re: [BUGS] BUG #2977: dow doesn't conform to ISO-8601

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Bruce Momjian <bruce(at)momjian(dot)us>
Cc: Peter Eisentraut <peter_e(at)gmx(dot)net>, Adriaan van Os <postgres(at)microbizz(dot)nl>, PostgreSQL-patches <pgsql-patches(at)postgresql(dot)org>
Subject: Re: [BUGS] BUG #2977: dow doesn't conform to ISO-8601
Date: 2007-02-19 17:44:28
Message-ID: 200702191744.l1JHiSw15345@momjian.us (view raw or flat)
Thread:
Lists: pgsql-bugspgsql-patches
Updated version applied.  I reduced the numering changes for the macros.

There was also documentation text for "dow" and a few others that said
"(for <type>timestamp</type> values only)", but in fact the field worked
for "timestamptz" and "date" too, so I removed the mentions.  If people
get confused, I will come up with new wording, like "doesn't work for
interval or time", which I think is pretty obvious.  I remember people
got confused in the past about this, so maybe we still need something.

---------------------------------------------------------------------------

Bruce Momjian wrote:
> 
> I have implemented 'isodow' with the attached patch.
> 
> ---------------------------------------------------------------------------
> 
> Peter Eisentraut wrote:
> > Am Mittwoch, 7. Februar 2007 11:24 schrieb Adriaan van Os:
> > > Section 9.9.1 of the Postgres docs
> > > <http://www.postgresql.org/docs/8.2/interactive/functions-datetime.html>
> > > mentions that the "week" subfield of the date_part function conforms to the
> > > ISO-8601 standard.
> > 
> > I see no such claim there.
> > 
> > > You can not, in the same function, ignore ISO-8601 for one subfield and
> > > follow it in another.
> > 
> > I think we have pretty well shown that we can.
> > 
> > > Besides, if in the same week Sunday comes before Monday, how can the result
> > > of the "week" and "dow" fields conform to each other ?
> > 
> > They don't.
> > 
> > > If "dow" can not be changed for reasons of backward compatibility, I
> > > suggest a new subfield "dayofweek" that does conform to the standard.
> > 
> > That might be reasonable. (Or maybe "isodow".)
> > 
> > -- 
> > Peter Eisentraut
> > http://developer.postgresql.org/~petere/
> > 
> > ---------------------------(end of broadcast)---------------------------
> > TIP 6: explain analyze is your friend
> 
> -- 
>   Bruce Momjian  <bruce(at)momjian(dot)us>          http://momjian.us
>   EnterpriseDB                               http://www.enterprisedb.com
> 
>   + If your life is a hard drive, Christ can be your backup. +


> 
> ---------------------------(end of broadcast)---------------------------
> TIP 5: don't forget to increase your free space map settings

-- 
  Bruce Momjian  <bruce(at)momjian(dot)us>          http://momjian.us
  EnterpriseDB                               http://www.enterprisedb.com

  + If your life is a hard drive, Christ can be your backup. +

Attachment: /rtmp/diff
Description: text/x-diff (7.5 KB)

In response to

Responses

pgsql-bugs by date

Next:From: Arjen van der MeijdenDate: 2007-02-19 18:52:23
Subject: BUG #3031: PHP (and others?) cannot close a connection when "in" a COPY-statement
Previous:From: Dr. Axel ReimannDate: 2007-02-19 13:43:18
Subject: BUG #3030: Unable to query SQL_WCHAR column via ODBC

pgsql-patches by date

Next:From: Alvaro HerreraDate: 2007-02-19 17:51:42
Subject: Re: [PATCHES] WIP patch - INSERT-able log statements
Previous:From: Guillaume SmetDate: 2007-02-19 17:31:53
Subject: Re: [PATCHES] WIP patch - INSERT-able log statements

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group