Re: Setting week starting day - Mailing list pgsql-general

From Jorge Godoy
Subject Re: Setting week starting day
Date
Msg-id 87bqj2at7f.fsf@gmail.com
Whole thread Raw
In response to Re: Setting week starting day  ("Ted Byers" <r.ted.byers@rogers.com>)
List pgsql-general
"Ted Byers" <r.ted.byers@rogers.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@gmail.com>

pgsql-general by date:

Previous
From: Jorge Godoy
Date:
Subject: Re: Setting week starting day
Next
From: "Damian C"
Date:
Subject: Re: Beginner's Questions