Re: date_trunct() and start of week - Mailing list pgsql-general

From Tom Lane
Subject Re: date_trunct() and start of week
Date
Msg-id 27291.1259335240@sss.pgh.pa.us
Whole thread Raw
In response to Re: date_trunct() and start of week  (Thomas Kellerer <spam_eater@gmx.net>)
List pgsql-general
Thomas Kellerer <spam_eater@gmx.net> writes:
> I'm just curious which setting defines whether monday or sunday is considered the "first day in a week"

A look at the source code (timestamptz_trunc) shows that truncation to
week start follows the ISO week conventions --- so weeks start on
Monday, regardless of locale.

Offhand I do not think that we pay attention to locale for any datetime
calculations.  However, there are other places that use Sunday for week
start, so it does matter which calculation you ask for ...

            regards, tom lane

pgsql-general by date:

Previous
From: "Shakil Shaikh"
Date:
Subject: Re: Invalid redo in checkpoint record
Next
From: Scott Marlowe
Date:
Subject: Re: READ ONLY & I/O ERROR