Re: Setting week starting day

From: Jorge Godoy <jgodoy(at)gmail(dot)com>
To: "Ted Byers" <r(dot)ted(dot)byers(at)rogers(dot)com>
Cc: "Omar Eljumaily" <omar2(at)omnicode(dot)com>, <pgsql-general(at)postgresql(dot)org>
Subject: Re: Setting week starting day
Date: 2007-03-09 23:32:52
Message-ID: 87bqj2at7f.fsf@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

"Ted Byers" <r(dot)ted(dot)byers(at)rogers(dot)com> writes:

> I don't buy the suggestion that server side code is less error prone that
> client side code, but be that as it may, we're talking about a function that
> has one line of code. And given what you just said, you don't want the day of
> the week, you want a function that returns the week of the year. This can be
> had from the same Perl functions I mentioned before, with a minor alteration
> in how you call it. my suggestion would be to create that one line function
> that invokes the relevant Perl function, which can then be invoked in your
> select statement (presumably with a group clause to avoid mixing data from
> different years). It should take about ten to fifteen minutes to write and
> test?

There's no need to use Perl.

neo=# select extract('week' from now());
date_part
-----------
10
(1 registro)

neo=#

Today is a day at the tenth week of the year.

--
Jorge Godoy <jgodoy(at)gmail(dot)com>

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Damian C 2007-03-09 23:35:15 Re: Beginner's Questions
Previous Message Jorge Godoy 2007-03-09 23:25:50 Re: Setting week starting day