On Wednesday 05 November 2003 09:49, Bj�rn T Johansen wrote:
> Yes, but the table in question have 3 PK and only one that needs this
> "sequence" so I just thought instead of getting holes in the IDs I just
> manually handle this counter somehow.. Not a big deal but... :)

Do you mean a 3-column primary key? By definition you can't have more than one 
primary key.

If you absolutely need to have no holes in your sequence numbers (e.g. for 
invoices) then you will have to handle it yourself. If you can live with 
them, it is much easier and quicker to use a sequence.

If you don't want holes, the simplest way is probably to have a "next_id" 
column in a system-settings table. You'll need to lock it before 
reading/updating and this will be a bottleneck when inserting new rows.
-- 
  Richard Huxton
  Archonet Ltd

---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]

Reply via email to