Re: Some frustrations with admin tasks on PGSQL database

From: hubert depesz lubaczewski <depesz(at)depesz(dot)com>
To: Phoenix Kiula <phoenix(dot)kiula(at)gmail(dot)com>
Cc: Postgres General <pgsql-general(at)postgresql(dot)org>
Subject: Re: Some frustrations with admin tasks on PGSQL database
Date: 2007-08-17 14:14:11
Message-ID: 20070817141411.GA9685@depesz.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Fri, Aug 17, 2007 at 07:49:08PM +0800, Phoenix Kiula wrote:
> I have dropped all indexes/indicises on my table, except for the
> primary key. Still, when I run the query:
> UPDATE mytable SET mycolumn = lower(mycolumn);

can you please check this:

select count(*) from mytable;
select count(*) from mytable where mycolumn ~ '[A-Z]';

and if the second is lower than first make the update:
update mytable set mycolumn = lower(mycolumn) where mycolumn ~ '[A-Z]';

of course if your data contain national characters you have to include
them (upper case only) in this regexp.

depesz

--
quicksil1er: "postgres is excellent, but like any DB it requires a
highly paid DBA. here's my CV!" :)
http://www.depesz.com/ - blog dla ciebie (i moje CV)

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message hubert depesz lubaczewski 2007-08-17 14:14:39 Re: Some frustrations with admin tasks on PGSQL database
Previous Message Magnus Hagander 2007-08-17 14:01:00 Re: Accessing pg_timezone_names system view