pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Amit Shah <ashah@opuspro.com>
To: pgsql-sql@postgresql.org
Subject: Query for block updates
Date: Sun, 03 Dec 2006 17:19:44 -0500
Message-ID: <200612031719.44642.ashah@opuspro.com> (raw)

Hi,

If this question doesn't belong to this mailing list, please pardon.

I have a table with a few hundred million rows, and I need to write a query 
that does something like follows --

Change all the values of a column to null where the value cannot be casted to 
numeric(20,4)

I have it as varchar, and I need to convert it to numeric(20,4).

I am using this query - alter table optiondata ALTER volume TYPE numeric(20,4) 
using cast(volume as numeric(20,4)); then wait for DB to complain, and then 
update that value to null, and just keep doing this till all garbadge is 
removed :-(

Thanks,
Amit



view thread (2+ messages)  latest in thread

Message-ID: <200612031719.44642.ashah@opuspro.com>
Permalink:  ../200612031719.44642.ashah@opuspro.com/
Also on:    postgresql.org/message-id/200612031719.44642.ashah@opuspro.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-sql@postgresql.org
  Cc: ashah@opuspro.com
  Subject: Re: Query for block updates
  In-Reply-To: <200612031719.44642.ashah@opuspro.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