Re: [GENERAL] How to Convert VarChar to Date in PgSQL

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: Venkat Rao Tammineni <vtammineni(at)roulacglobal(dot)com>
Cc: pgsql-general(at)postgresql(dot)org, pgsql-admin(at)postgresql(dot)org
Subject: Re: [GENERAL] How to Convert VarChar to Date in PgSQL
Date: 2009-03-10 12:14:07
Message-ID: 162867790903100514u19ee4d0cje262cd98f213ae4a@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin pgsql-general

hello

2009/3/10 Venkat Rao Tammineni <vtammineni(at)roulacglobal(dot)com>:
> 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.
>
>
>

use function to_date, please

http://www.postgresql.org/docs/8.3/static/functions-formatting.html

postgres=# select to_date('2009-07-17', 'YYYY-MM-DD');
to_date
----------
2009-07-17
(1 row)

regards
Pavel Stehule

>
>
>
>
> ?Thanx & Regards
>
>  Venkat Rao Tammineni
>
> GIS Developer
>
>

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Pavel Stehule 2009-03-10 12:16:35 Re: [GENERAL] How to Convert VarChar to Date in PgSQL
Previous Message A. Kretschmer 2009-03-10 12:13:43 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:16:35 Re: [GENERAL] How to Convert VarChar to Date in PgSQL
Previous Message A. Kretschmer 2009-03-10 12:13:43 Re: How to Convert VarChar to Date in PgSQL