X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (neptune.hub.org [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id CA712D1DAAE for ; Tue, 27 Jan 2004 09:35:02 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 61526-04 for ; Tue, 27 Jan 2004 05:34:33 -0400 (AST) Received: from domino.nc.com.my (domino.nc.com.my [202.185.214.131]) by svr1.postgresql.org (Postfix) with ESMTP id 41E33D1DA2E for ; Tue, 27 Jan 2004 05:34:28 -0400 (AST) Subject: Re: time series data To: pgsql-sql@postgresql.org X-Mailer: Lotus Notes Release 5.0 (Intl) 30 March 1999 Message-ID: From: azwa@nc.com.my Date: Tue, 27 Jan 2004 09:42:27 +0800 X-MIMETrack: Serialize by Router on domino/ANSI(Release 5.0.5 |September 22, 2000) at 01/27/2004 05:12:13 PM, Serialize complete at 01/27/2004 05:12:13 PM MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="=_alternative 000BA23748256E28_=" X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200401/220 X-Sequence-Number: 16613 This is a multipart message in MIME format. --=_alternative 000BA23748256E28_= Content-Type: text/plain; charset="iso-8859-2" Content-Transfer-Encoding: quoted-printable Hi, thanks for the info..btw can u pls explain a little bit detail since i= =20 can't get thru yr solution. thanks in advance Dnia 2004-01-21 10:37, U=BFytkownik Tomasz Myrta napisa=B3: > Use this integer sequence and interval datatype to get date result: > your_date=3D'1994-01-01'::date+'1 day'::integer * time_key ^^^^^^^ Sorry, use interval here. Regards, Tomasz Myrta azwa@postgresql.org Sent by: pgsql-sql-owner@postgresql.org 01/21/2004 04:53 PM To: pgsql-sql@postgresql.org cc:=20 Subject: [SQL] time series data Hi,=20 i want to create time table & the structure as below :=20 =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20 Column=20 Type=20 Modifiers=20 time_key=20 yr_id=20 month_id=20 month_desc=20 day_id=20 integer=20 integer=20 integer=20 text=20 integer=20 not null default nextval('time_seq'::text) Example of data in time table:=20 Time_key=20 yr_id=20 month_id=20 month_desc=20 day_id=20 1999=20 1=20 Jan=20 1=20 1999=20 1=20 Jan=20 2=20 2000=20 1=20 Jan=20 1 time_key data will keep increment reading from sequence. i'm going to have= =20 a data from yr_id =3D1994 --> 2009 , month_id =3D1 -->12=20 and day_id =3D1 -->31 for each month. So is there any solution (using=20 function, or else) that can give me the above data=20 in Postgresql??.=20 thanks in advance. --=_alternative 000BA23748256E28_= Content-Type: text/html; charset="iso-8859-2" Content-Transfer-Encoding: quoted-printable

Hi,

   thanks for the info..b= tw can u pls explain a little bit detail since i can't get thru yr solution= .
thanks in advance


Dnia 2004-01-21 10:37, U=BFytkownik= Tomasz Myrta napisa=B3:

> Use this integer sequence and interval datatype to get date result:
> your_date=3D'1994-01-01'::date+'1 day'::integer * time_key
                    &nbs= p;                     &n= bsp;                     =            ^^^^^^^
Sorry, use interval here.

Regards,
Tomasz Myrta



azwa@postgresql.o= rg

Sent by: pgsql-sql-owner@postgresql.= org

01/21/2004 04:53 PM


        To: &nbs= p;      pgsql-sql@postgresql.org
        cc: &nbs= p;      
        Subject:=        [SQL] time series data




Hi,



   i want to create time table  & the structure as belo= w :


             
 
Column  Type  Modifiers
time_key
yr_id

month_id

month_desc

day_id
 integer
integer

integer

text

integer
 not null default nextval('time= _seq'::text)




Example of data in time table:
Time_key  yr_id   month_id   month_desc   day_id
 1999   1   Jan   1
 1999   1   Jan   2
 2000   1   Jan   1




time_key data will keep increment reading from sequence. i'm going to have = a data from yr_id =3D1994 --> 2009 , month_id =3D1 -->12
and day_id =3D1 -->31 for each month. So is there any solution (using fu= nction, or else) that can give me the  above data

in Postgresql??.


thanks in advance.

--=_alternative 000BA23748256E28_=--