pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Pavel Stehule <pavel.stehule@gmail.com>
To: Venkat Rao Tammineni <vtammineni@roulacglobal.com>
Cc: pgsql-general@postgresql.org
Cc: pgsql-admin@postgresql.org
Subject: Re: [GENERAL] How to Convert VarChar to Date in PgSQL
Date: Tue, 10 Mar 2009 13:14:07 +0100
Message-ID: <162867790903100514u19ee4d0cje262cd98f213ae4a@mail.gmail.com> (raw)
In-Reply-To: <005901c9a178$d00c3c20$7024b460$@com>
References: <005901c9a178$d00c3c20$7024b460$@com>

hello

2009/3/10 Venkat Rao Tammineni <vtammineni@roulacglobal.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
>
>



view thread (6+ messages)  latest in thread

Message-ID: <162867790903100514u19ee4d0cje262cd98f213ae4a@mail.gmail.com>
Permalink:  ../162867790903100514u19ee4d0cje262cd98f213ae4a@mail.gmail.com/
Also on:    postgresql.org/message-id/162867790903100514u19ee4d0cje262cd98f213ae4a@mail.gmail.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-admin@postgresql.org
  Cc: pavel.stehule@gmail.com, vtammineni@roulacglobal.com, pgsql-general@postgresql.org
  Subject: Re: [GENERAL] How to Convert VarChar to Date in PgSQL
  In-Reply-To: <162867790903100514u19ee4d0cje262cd98f213ae4a@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox