Forum OpenACS Development: Re: How to select all dates on Postgres?

Collapse
Posted by Steve Manning on

Jade

If its a Postgres 8+ then its trivial using the generate_series() function  see http://www.postgresql.org/docs/8.0/interactive/functions-srf.html

e.g

select current_date + s.a as dates from generate_series(0,14,7) as s(a);
   dates
------------
 2004-02-05
 2004-02-12
 2004-02-19

(3 rows)

 I don't think this function was available before 8 but it may be possible to hand craft your own version.

 
    - Steve