Rob Brown-Bayliss <rob(at)zoism(dot)org> writes:
> sequence_number := to_char(nextval(''location_seq''),''99999MI'');
> The location_seq is up to 100005 at the moment so how am I getting
> duplicate primary keys?
Time for more 9's in that to_char format, perhaps?
regards, tom lane