Have a look at this simpler non looping version of week_start()
That is a nice idea. I had to modify it a bit in order to get
the same answers as my other function ...
CREATE or REPLACE FUNCTION week_start2(integer, integer) RETURNS date AS '
DECLARE
pyear ALIAS FOR $1;
pweek
Lee,
Have a look at this simpler non looping version of week_start()
-- return the first date in the given week
CREATE or REPLACE FUNCTION week_start(integer, integer)
RETURNS date
LANGUAGE 'plpgsql'
AS '
DECLARE
pyear ALIAS FOR $1;
pweek ALIAS FOR $2;
year_start date;
week_interval