Update bug.
| От | Rick Szeto | 
|---|---|
| Тема | Update bug. | 
| Дата | |
| Msg-id | scd68c2a.004@toronto.csi.ca обсуждение исходный текст  | 
		
| Список | pgsql-bugs | 
Hi all,
   I have encountered a bug that I think is a major problem.
I have a table as follows:
  CREATE TABLE registration (
    registration_id    int PRIMARY KEY;
    course_name     varchar(6) NOT NULL;
    course_code      varchar(6) NOT NULL;
    etc...
)
Note: There is no index on course_name and/or course_code;
I needed to update the values in course_name and course_code columns to rem=
ove trailling whitespace.
(you don't want to know how they got there...). So I used this statement to=
 update it:
UPDATE registration SET course_name =3D trim(course_name), course_code =3D =
trim(course_code);
At first I just thought that the operation took a long time(it does have ov=
er 300k entries), so I left it over night to run.
But when I got back the next morning, the process was still not finished. W=
hen I looked at the CPU usage using 'top',
postgres was basically sitting idle. I had to use the a PL/pgsql function t=
o operate on the table for it to do the update,=20
it was slow, but at least it did the job.
Configuration:
    RH Linux 7.2 on Intel P4 1.6 GHz.
    PostgreSQL 7.2.1
Any reason why this is happening?
Thanks for your help,
Rick
		
	В списке pgsql-bugs по дате отправления: