Re: [SQL] unique key problem on update

2013-09-20 Thread Thomas Kellerer
Gary Stainburn wrote on 20.09.2013 18:07: I want to add a new page after page 2 so I try to increase the sequence number of each row from page 3 onwards to make space in the sequence for the new record. However, I get duplicate key errors when I try. Can anyone suggest how I get round this. Also

Re: [SQL] unique key problem on update

2013-09-20 Thread Thomas Kellerer
Gary Stainburn wrote on 20.09.2013 18:30: You need to define the primary key as deferrable: create table skills_pages ( sp_idserial not null, sp_sequence integer not null, sp_title character varying(80), sp_narative text, primary key (sp_id) deferrable ); Cheers. I

Re: [SQL] unique key problem on update

2013-09-20 Thread Gary Stainburn
On Friday 20 September 2013 17:26:58 Thomas Kellerer wrote: > You need to define the primary key as deferrable: > > create table skills_pages > ( > sp_idserial not null, > sp_sequence integer not null, > sp_title character varying(80), > sp_narative text, > primary key (sp_i

[SQL] unique key problem on update

2013-09-20 Thread Gary Stainburn
Hi folks. I've got the table and data shown below. I want to add a new page after page 2 so I try to increase the sequence number of each row from page 3 onwards to make space in the sequence for the new record. However, I get duplicate key errors when I try. Can anyone suggest how I get roun