Re: time series data

From: Tomasz Myrta <jasiek(at)klaster(dot)net>
To: azwa(at)nc(dot)com(dot)my
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: time series data
Date: 2004-01-27 09:56:49
Message-ID: 401635E1.8040204@klaster.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-sql

Dnia 2004-01-27 02:42, Użytkownik azwa(at)nc(dot)com(dot)my napisał:
>
>
> Hi,
>
> thanks for the info..btw can u pls explain a little bit detail since
> i can't get thru yr solution.
> thanks in advance

insert into time_table (time_key,year_id,month_id,month_desc,day_id)
select
newid,
extract('year' from your_date),
extract('month' from your_date),
to_char(your_date,'mon'),
extract('day' from your_date)
...
from (select nextval('time_seq') as newid,
'1994-01-01'::date+'1 day'::interval * currval('time_seq') as your_date) x;

Everything you need is to execute query above as many times as you need.

Regards,
Tomasz Myrta

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message pgsql-bugs 2004-01-27 10:37:46 Returned due to virus; was:hi
Previous Message azwa 2004-01-27 01:42:27 Re: time series data

Browse pgsql-sql by date

  From Date Subject
Next Message JinNet Picker 2004-01-27 10:50:30 Postgres "dblink" Help
Previous Message Robert Creager 2004-01-27 03:23:38 Re: [SQL] Database diagram