[GENERAL] Re: Why the ERROR: duplicate key violates unique constraint master_pkey is raised? - Is this a Bug?

2007-09-28 Thread Nis Jørgensen
Alban Hertroys skrev: Nis Jørgensen wrote: If you can't wait, you are probably better off working around the problem. Standard solution is to do: UPDATE master SET m2 = -m2; UPDATE master SET m2 = -m2+1; or something similar. Would something like UPDATE master set m2 = master2.m2

Re: [GENERAL] Re: Why the ERROR: duplicate key violates unique constraint master_pkey is raised? - Is this a Bug?

2007-09-28 Thread Alban Hertroys
Nis Jørgensen wrote: Alban Hertroys skrev: Would something like UPDATE master set m2 = master2.m2 FROM ( SELECT m2 +1 FROM master m WHERE m.master_id = master.master_id ORDER BY m2 DESC ) master2 work? I think it might be faster (and possibly cause less index

Re: [GENERAL] Re: Why the ERROR: duplicate key violates unique constraint master_pkey is raised? - Is this a Bug?

2007-09-28 Thread Alban Hertroys
Nis Jørgensen wrote: If you can't wait, you are probably better off working around the problem. Standard solution is to do: UPDATE master SET m2 = -m2; UPDATE master SET m2 = -m2+1; or something similar. Would something like UPDATE master set m2 = master2.m2 FROM ( SELECT m2

[GENERAL] Re: Why the ERROR: duplicate key violates unique constraint master_pkey is raised? - Is this a Bug?

2007-09-28 Thread Nis Jørgensen
Alban Hertroys skrev: Nis Jørgensen wrote: Alban Hertroys skrev: Would something like UPDATE master set m2 = master2.m2 FROM ( SELECT m2 +1 FROM master m WHERE m.master_id = master.master_id ORDER BY m2 DESC ) master2 work? I think it might be faster (and

[GENERAL] Re: Why the ERROR: duplicate key violates unique constraint master_pkey is raised? - Is this a Bug?

2007-09-28 Thread Alban Hertroys
I had to manipulate the headers a bit, as I hadn't noticed the message that reached me first was from the newsgroup instead of the ML. Nis Jørgensen wrote: Alban Hertroys skrev: As I said, I don't understand what you think it does. What you are doing is similar to writing SELECT m2 FROM

[GENERAL] Re: Why the ERROR: duplicate key violates unique constraint master_pkey is raised? - Is this a Bug?

2007-09-28 Thread Nis Jørgensen
Alban Hertroys skrev: Nis Jørgensen wrote: Alban Hertroys skrev: As I said, I don't understand what you think it does. What you are doing is similar to writing SELECT m2 FROM master, ( SELECT m2 FROM master m WHERE m.master_id = master.master_id ) Which doesn'

[GENERAL] Re: Why the ERROR: duplicate key violates unique constraint master_pkey is raised? - Is this a Bug?

2007-09-27 Thread Nis Jørgensen
Ardian Xharra skrev: *From:* Anoo Sivadasan Pillai mailto:[EMAIL PROTECTED] I am not using any sequences, The following batch can reproduce the behaviour. CREATE TABLE master ( m1 INT primary key , m2 int unique ) ; INSERT INTO master VALUES ( 1, 1 ) ; INSERT INTO master VALUES ( 2, 2)