Re: Setting week starting day (was: Re: Tabulate data incrementally) - Mailing list pgsql-general

From Alvaro Herrera
Subject Re: Setting week starting day (was: Re: Tabulate data incrementally)
Date
Msg-id 20070308221047.GE4715@alvh.no-ip.org
Whole thread Raw
In response to Setting week starting day (was: Re: Tabulate data incrementally)  (Jorge Godoy <jgodoy@gmail.com>)
Responses Re: Setting week starting day  (Jorge Godoy <jgodoy@gmail.com>)
List pgsql-general
Jorge Godoy escribió:

> I mean, if I wanted to do the above but instead of Sunday or Monday as the
> starting day I'd like using Fridays or Wednesdays...
>
> Is it possible?  Writing a new function shouldn't be too hard -- it's a matter
> of truncating the week on a day and shifting the date forward or backward --,
> but something like a "SET bow=5" (to make the API consistent with the 'dow'
> that already exists) would be really great!

Is it not just a matter of adding a constant and then taking modulo 7?

--
Alvaro Herrera                                http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support

pgsql-general by date:

Previous
From: Devrim GÜNDÜZ
Date:
Subject: Re: "oracle to postgresql" conversion
Next
From: Shane Ambler
Date:
Subject: Re: security permissions for functions