Query for block updates

From: Amit Shah <ashah(at)opuspro(dot)com>
To: pgsql-sql(at)postgresql(dot)org
Subject: Query for block updates
Date: 2006-12-03 22:19:44
Message-ID: 200612031719.44642.ashah@opuspro.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

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

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Tom Lane 2006-12-03 22:22:49 Re: Query for block updates
Previous Message Bruce Momjian 2006-12-03 16:57:06 Re: [HACKERS] Case Preservation disregarding case