On Fri, Jan 17, 2003 at 11:38:24AM -0500, Bruce Momjian wrote:
> Tom Lane wrote:
> > 
> > A small difficulty is that explicitly-specified sysids could conflict
> > with sysids generated later by the sequence.  We could perhaps fix this
> > by forcing up the sequence setting to be at least as large as an
> > explicitly-given ID (compare the handling of explicitly loaded OIDs).
> A sequence sounds like a good idea.  When we create a user, we can use
> MAX() to find the maximum, and if that is less than the sequence value,
> bump up the sequence to equal max and add the row, again incrementing
> the sequence.  Another idea would be to put a trigger on the column so
> that any INSERT/UPDATE would automatically bump up the sequence with
> setval().

Hmm, unlike the OID case, I'd think there's unlikely to be many 'preused'
userids. Why not just retry if the sequence hits an existing entry? 


---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?


Reply via email to