On 3/5/08, A. Kretschmer <andreas(dot)kretschmer(at)schollglas(dot)com> wrote:
> With generate_series() i generate a list of dates, and later i check if
> the date are a saturday. Okay, you need to know sunday -> change from 6
> to 0 and ou course, you can calculate the parameter for the
> generate_series like
I find it convenient to create a custom version of generate_series:
CREATE OR REPLACE FUNCTION generate_series(date,date)
RETURNS SETOF date AS $$
SELECT $1 + n FROM generate_series(0,$2-$1) AS x(n)
$$ LANGUAGE SQL IMMUTABLE;
Regards,
Dawid