why not use a GUID ?
http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/163604

On 13/07/2006, at 8:08 AM, Jay Parlar wrote:

>
> On 7/12/06, Don Arbow <[EMAIL PROTECTED]> wrote:
>>
>> On Jul 12, 2006, at 8:56 AM, Jay Parlar wrote:
>>>
>>> Is there a better way to do this? More specifically, an atomic  
>>> way to
>>> generate and set the new unique_id? I can't just use the  
>>> autogenerated
>>> 'id' primary key as an unique identifier, because I have a list of
>>> legacy unique_id values which I have to initially populate the db
>>> with.
>>>
>>
>>
>> You could populate your database with the legacy values, then set the
>> sequence start number to the number following those.
>>
>> You can do this in postgres with the setval function.
>>
>
>
> What about a table lock? My whole system is currently implemented with
> the unique_id column, so it'd be much easier if I didn't have to
> change that.
>
> The stuff that happens inside the view is minimal, so there'd be very
> little performance loss if one process was waiting for the lock to
> release.
>
> Jay P.
>
> >


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~----------~----~----~----~------~----~------~--~---

Reply via email to