From: Jaume Sabater <jsabater@gmail.com>
To: Venkat Rao Tammineni <vtammineni@roulacglobal.com>
Cc: pgsql-general@postgresql.org
Cc: pgsql-admin@postgresql.org
Subject: Re: How to Convert VarChar to Date in PgSQL
Date: Tue, 10 Mar 2009 13:11:27 +0100
Message-ID: <3786f7bb0903100511t5fe45b63tbe84b502b0d64bbc@mail.gmail.com> (raw)
In-Reply-To: <005901c9a178$d00c3c20$7024b460$@com>
References: <005901c9a178$d00c3c20$7024b460$@com>
On Tue, Mar 10, 2009 at 1:07 PM, Venkat Rao Tammineni
<vtammineni@roulacglobal.com> wrote:
> 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.
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.
--
Jaume Sabater
http://linuxsilo.net/
"Ubi sapientas ibi libertas"
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: jsabater@gmail.com, vtammineni@roulacglobal.com, pgsql-general@postgresql.org
Subject: Re: How to Convert VarChar to Date in PgSQL
In-Reply-To: <3786f7bb0903100511t5fe45b63tbe84b502b0d64bbc@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