X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id 86C40D1CA6F for ; Fri, 3 Oct 2003 19:47:14 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 25907-09 for ; Fri, 3 Oct 2003 16:46:27 -0300 (ADT) Received: from wolff.to (wolff.to [66.93.249.74]) by svr1.postgresql.org (Postfix) with SMTP id D87F4D1B917 for ; Fri, 3 Oct 2003 16:37:33 -0300 (ADT) Received: (qmail 23149 invoked by uid 500); 3 Oct 2003 19:44:53 -0000 Date: Fri, 3 Oct 2003 14:44:53 -0500 From: Bruno Wolff III To: Jan Pips Cc: pgsql-sql@postgresql.org Subject: Re: Data type conversion Message-ID: <20031003194453.GA23110@wolff.to> Mail-Followup-To: Jan Pips , pgsql-sql@postgresql.org References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.4i X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200310/54 X-Sequence-Number: 15454 On Fri, Oct 03, 2003 at 09:23:46 +0200, Jan Pips wrote: > How to convert the interval type into integer, float or any "countable" data > type at the time of table creation using > select ... into? You can use extract to do that. See the date/time function documentation. Note that months get treated as 30 days when extracting periods less than a month from an interval.