X-Original-To: pgsql-novice-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id D0B6D5E37D0 for ; Thu, 12 Aug 2004 13:58:10 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 51140-06 for ; Thu, 12 Aug 2004 16:58:09 +0000 (GMT) Received: from happy.onesystem.ca (happy.onesystem.ca [205.206.61.17]) by svr1.postgresql.org (Postfix) with ESMTP id D26D95E46D5 for ; Thu, 12 Aug 2004 13:58:00 -0300 (ADT) Received: from elb_lx.onesystem.ca ([10.1.1.50]) by happy.onesystem.ca with asmtp (Exim 4.14) id 1BvIu0-0004g0-DH; Thu, 12 Aug 2004 10:58:08 -0600 Message-ID: <411BA1A0.8010206@onesystem.com> Date: Thu, 12 Aug 2004 10:58:08 -0600 From: Edmund Bacon User-Agent: Mozilla Thunderbird 0.7.1 (X11/20040626) X-Accept-Language: en-us, en MIME-Version: 1.0 To: "Pradeepkumar, Pyatalo (IE10)" Cc: pgsql-novice@postgresql.org Subject: Re: [SQL] how to cast localtimestamp to bigint??? References: <77ED2BF75D59D1439F90412CC5B109741027FF0F@ie10-sahara.hiso.honeywell.com> In-Reply-To: <77ED2BF75D59D1439F90412CC5B109741027FF0F@ie10-sahara.hiso.honeywell.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200408/162 X-Sequence-Number: 10699 I would have expected SELECT current_timestamp::abstime::bigint; to have worked, but there is no conversion abstime -> bigint. Instead use SELECT current_timestamp::abstime::int::bigint; The final cast to bigint is not strictly neccessary. This all begs the question, though, of why you are using a bigint for createtime and not a timestamp? Pradeepkumar, Pyatalo (IE10) wrote: > Hi, > > I am having a table something like this.... > > CREATE TABLE(PointId integer, PointName varchar(50),PointType integer, > createtime bigint); > > where createtime is the current timestamp when the tuple is inserted. > > now how do I insert values into the above table. Is there a way to cast > timestamp to bigint. > Also can anyone suggest as to which date function to use - > CURRENT_TIMESTAMP, LOCALTIMESTAMP, timeofday(), now.... > > > >>With Best Regards >>Pradeep Kumar P J >> > > > ---------------------------(end of broadcast)--------------------------- > TIP 4: Don't 'kill -9' the postmaster -- Edmund Bacon