Henry Ortega wrote:

(question about set of all days between two dates)

I don't know of a builtin way to do it off the top of my head, but it's a 
pretty simple function to write:

create function days (start date, finish date) returns setof date as $$
declare
  curdate date;
begin
  curdate := start;
  while (curdate <= finish) loop
    return next curdate;
    curdate := curdate + 1;
  end loop;
  return;
end;
$$ language plpgsql;

# select * from days ('2006-02-01', '2006-02-07');
    days
------------
 2006-02-01
 2006-02-02
 2006-02-03
 2006-02-04
 2006-02-05
 2006-02-06
 2006-02-07
(7 rows)


---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings

Reply via email to