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 5DC78D1D486 for ; Tue, 27 Jan 2004 09:56:07 +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 69241-08 for ; Tue, 27 Jan 2004 05:55:37 -0400 (AST) Received: from serwer.skawsoft.com.pl (skawina.eu.org [80.48.213.66]) by svr1.postgresql.org (Postfix) with ESMTP id 2A9E3D1D4E7 for ; Tue, 27 Jan 2004 05:55:35 -0400 (AST) Received: from klaster.net (backbone.zab.citynet.pl [212.244.6.69]) by serwer.skawsoft.com.pl (Postfix) with ESMTP id 3F5642B3D6; Tue, 27 Jan 2004 10:54:59 +0100 (CET) Message-ID: <401635E1.8040204@klaster.net> Date: Tue, 27 Jan 2004 10:56:49 +0100 From: Tomasz Myrta User-Agent: Mozilla/5.0 (Windows; U; Win 9x 4.90; pl-PL; rv:1.6b) Gecko/20031208 X-Accept-Language: pl, en-us, en MIME-Version: 1.0 To: azwa@nc.com.my Cc: pgsql-sql@postgresql.org Subject: Re: time series data References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-2; format=flowed Content-Transfer-Encoding: 8bit X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200401/221 X-Sequence-Number: 16614 Dnia 2004-01-27 02:42, Użytkownik azwa@nc.com.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