Re: Primary Key problem

From: Oliver Elphick <olly(at)lfix(dot)co(dot)uk>
To: ebp <ebp_register(at)yahoo(dot)com>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: Primary Key problem
Date: 2002-03-04 21:33:07
Message-ID: 1015277588.1406.58.camel@linda
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

On Mon, 2002-03-04 at 19:13, ebp wrote:
> I was wondering how i could check/increment the key value, possibly to find out if there is data after the current key value. I believe that when we imported some files, they threw off the key values for some reason, probably jumping to some other starting point than the next available value.

select setval('kbeg_sequence',(select max(your_sequence_field) from
kbeg));
--
Oliver Elphick Oliver(dot)Elphick(at)lfix(dot)co(dot)uk
Isle of Wight http://www.lfix.co.uk/oliver
GPG: 1024D/3E1D0C1C: CA12 09E0 E8D5 8870 5839 932A 614D 4C34 3E1D 0C1C

"Give, and it will be given to you. A good measure,
pressed down, taken together and running over,
will be poured into your lap. For with the same
measure that you use, it will be measured to
you." Luke 6:38

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Jon Hassen 2002-03-04 22:18:33 Index item size 4496 exceeds maximum 2713
Previous Message Josh Berkus 2002-03-04 21:04:20 Re: Do Stored Procedures exist (Besides FUNCTIONs)