Received: from localhost (unknown [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id 7ED13633EA3; Tue, 10 Mar 2009 09:12:44 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.208.211]) (amavisd-maia, port 10024) with ESMTP id 26893-08-2; Tue, 10 Mar 2009 09:12:33 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-fx0-f168.google.com (mail-fx0-f168.google.com [209.85.220.168]) by mail.postgresql.org (Postfix) with ESMTP id 31D2F6361D4; Tue, 10 Mar 2009 09:11:30 -0300 (ADT) Received: by fxm12 with SMTP id 12so2328977fxm.19 for ; Tue, 10 Mar 2009 05:11:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=9d5U92+9/0XY8kiqnIWW9cYtv+utDfvPw/M9c2UTHaE=; b=CQhIsQf0yD4jZ4Dg1Lvx1IZSGPPEk3KZ6P840ZWPsK4ORC0VJBELcF15fobsvomCnW rqvaJ/GrVB7yrrmwnsAp5Vtn3S1gVjfzQ2narU1TIWMjiq5wlw4lcqrrXsi+dR3HRNs3 z2bSOWbUu5PM0YurfRfzs3ykmQKS9CNo1UbII= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=gS4dry0k4iaqYf+qG2WFBPfUizHsnzlwLBvm7DYzkXoYcnSGSLnhnCjn0IyCpXCeED +UXXE5nAlktQyc2wICqAuU4l4IMr0+04/4MLyqjkm/iGook52a4t3MWfEHYpiMILmiWB Jd1mxSMmqGXdrO3UcqzURbPOA4bQOEgcrSm2A= MIME-Version: 1.0 Received: by 10.223.112.130 with SMTP id w2mr5283763fap.65.1236687088084; Tue, 10 Mar 2009 05:11:28 -0700 (PDT) In-Reply-To: <005901c9a178$d00c3c20$7024b460$@com> References: <005901c9a178$d00c3c20$7024b460$@com> Date: Tue, 10 Mar 2009 13:11:27 +0100 Message-ID: <3786f7bb0903100511t5fe45b63tbe84b502b0d64bbc@mail.gmail.com> Subject: Re: How to Convert VarChar to Date in PgSQL From: Jaume Sabater To: Venkat Rao Tammineni Cc: pgsql-general@postgresql.org, pgsql-admin@postgresql.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests=none X-Spam-Level: X-Archive-Number: 200903/128 X-Sequence-Number: 31628 On Tue, Mar 10, 2009 at 1:07 PM, Venkat Rao Tammineni wrote: > =C2=A0 I have one table which has lot of data.In the same table I have on= e > varchar filed. I want to convert into Date data type? Is It possible to > convert varchar to date datatype with out loosing data.Please guide me.I = am > waiting for your great response. An easy solution would be to add a new column to the table, of type date, and then execute an update statement that reads, for each row, the value in the varchar field and writes the converted value to the date field. --=20 Jaume Sabater http://linuxsilo.net/ "Ubi sapientas ibi libertas"