Received: from localhost (unknown [200.46.204.184]) by postgresql.org (Postfix) with ESMTP id 97E952E0031 for ; Wed, 26 Mar 2008 13:03:54 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-maia, port 10024) with ESMTP id 90213-01 for ; Wed, 26 Mar 2008 13:03:36 -0300 (ADT) X-Greylist: delayed 00:06:38.743818 by SQLgrey-1.7.5 Received: from mail.xmtservices.net (unknown [66.224.65.210]) by postgresql.org (Postfix) with SMTP id 552B82E0049 for ; Wed, 26 Mar 2008 13:03:37 -0300 (ADT) Received: (qmail 2116 invoked from network); 26 Mar 2008 15:56:55 -0000 Received: from unknown (HELO vaio.xmtservices.net) (192.168.0.101) by errol.xmtservices.net with SMTP; 26 Mar 2008 15:56:55 -0000 From: Shawn To: pgsql-sql@postgresql.org Subject: Part 1 of several - Converting a varchar to an interval Date: Wed, 26 Mar 2008 15:56:54 +0000 User-Agent: KMail/1.9.9 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200803261556.54418.postgres@xmtservices.net> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200803/171 X-Sequence-Number: 30499 Hello, I have several large tables, over 100 million records each. One of the fields is callee 'duration'. It is a varchar that contains what is essentially an integer that is the duration of an event in milleseconds. Could someone tell me a simple way to convert a value such as 134987 stored in a varchar into an interval? This will dovetail with my next question. Thanks for all the help both now and previous. Shawn