Re: How to Convert VarChar to Date in PgSQL

From: "A(dot) Kretschmer" <andreas(dot)kretschmer(at)schollglas(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: How to Convert VarChar to Date in PgSQL
Date: 2009-03-10 12:13:43
Message-ID: 20090310121343.GC13749@a-kretschmer.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin pgsql-general

In response to Venkat Rao Tammineni :
> Dear All,
>
>
>
>
>
> I have one table which has lot of data.In the same table I have one 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.

Sure, if you have valid varchar-data.

to_date('2009-03-11'::text, 'yyyy-mm-dd');

Andreas
--
Andreas Kretschmer
Kontakt: Heynitz: 035242/47150, D1: 0160/7141639 (mehr: -> Header)
GnuPG-ID: 0x3FFF606C, privat 0x7F4584DA http://wwwkeys.de.pgp.net

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Pavel Stehule 2009-03-10 12:14:07 Re: [GENERAL] How to Convert VarChar to Date in PgSQL
Previous Message Jaume Sabater 2009-03-10 12:11:27 Re: How to Convert VarChar to Date in PgSQL

Browse pgsql-general by date

  From Date Subject
Next Message Pavel Stehule 2009-03-10 12:14:07 Re: [GENERAL] How to Convert VarChar to Date in PgSQL
Previous Message Jaume Sabater 2009-03-10 12:11:27 Re: How to Convert VarChar to Date in PgSQL