Re: pg_generate_sequence and info_schema patch (Was: SELECT - Mailing list pgsql-patches

From Joe Conway
Subject Re: pg_generate_sequence and info_schema patch (Was: SELECT
Date
Msg-id 402178B5.9050008@joeconway.com
Whole thread Raw
In response to Re: pg_generate_sequence and info_schema patch (Was: SELECT  (Christopher Kings-Lynne <chriskl@familyhealth.com.au>)
List pgsql-patches
Christopher Kings-Lynne wrote:
> Having something that generates a list of dates would be handy, however
> I guess you can do it with the current series generator by adding that
> many day intervals to a base date...

Seems to work:

regression=# select current_date + s.a as dates from
generate_series(1,3) as s(a);
    dates
------------
  2004-02-05
  2004-02-06
  2004-02-07
(3 rows)

Or even:

regression=# select current_date + s.a * '1 week'::interval as dates
from generate_series(1,3) as s(a);
         dates
---------------------
  2004-02-11 00:00:00
  2004-02-18 00:00:00
  2004-02-25 00:00:00
(3 rows)

Joe



pgsql-patches by date:

Previous
From: "Magnus Hagander"
Date:
Subject: temp patch for win32 readdir issue
Next
From: "Magnus Hagander"
Date:
Subject: Re: temp patch for win32 readdir issue