Re: Date Questions - Mailing list pgsql-general

From Robert Sanford
Subject Re: Date Questions
Date
Msg-id B7FA3B7327F5D043AB403A1E0709628CECDC26@exchg3.corp.orrtax.local
Whole thread Raw
In response to Re: Date Questions  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
Every app has its joyful inconsistencies and learning them is part of
the process...

So if I'm currently doing a GROUP BY date_part(week, datecolumn) in a
view and  I really want to be using the DOW convention I need to write a
customized get_sunday_week_num (date) to make everything consistent. Or,
did someone else run into this problem and solve it before me?

rjsjr

PS - Coming from an MS-SQL Server background I *love* the date
functionality in PostgreSQL.

> -----Original Message-----
> From: Tom Lane [mailto:tgl@sss.pgh.pa.us]
> Sent: Tuesday, January 23, 2007 5:40 PM
> To: Robert Sanford
> Cc: pgsql-general@postgresql.org
> Subject: Re: [GENERAL] Date Questions
>
> "Robert Sanford" <rsanford@trefs.com> writes:
> > It appears to me that there is some inconsistency in the date
> > calculations for my PostgreSQL install (version 8.0 on Win32).
>
> extract(DOW) follows the convention that the week starts on
> Sunday, but extract(WEEK) uses the ISO convention, which
> includes weeks starting on Monday.  No, it's not super
> consistent, but hardly anything about date/time conventions is :-(
>
>             regards, tom lane
>

pgsql-general by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: dump desde dentro de una base
Next
From: Bruno Wolff III
Date:
Subject: Re: Date Questions