Everything is happening in a Postgres transaction; at the first error
the transaction aborts and you must issue a ROLLBACK to the DB before
continuing. Consult Django's transaction dogs for information on how
to do this.


On 2/14/09, 83...@gmx.de <83...@gmx.de> wrote:
>
> Hi Folks,
>
> I'd like to update/initiate a database with an unique=True Field.
>
> It shall be a "batch-process" (List of entries to take over into the
> database.
>
> for item in leasing:
>       l = Leasing(leasing = item)
>       try:
>          l.save()
>       except IntegrityError,e :
>          errors.append(e)
>       except:
>          pass
>       leasing.append(errors)
>
> same with except (ProgramminError, IntegrityError), e
>
> First IntegrityError-Exception will be catched but next not - I get an
> ProgrammingError
>
>               SET client_encoding to 'UNICODE'..........
>
> and all other entries in the list will be skiped with the same error-
> message... no storing into the database even though there's no
> IntegrityErros (unique elements).
>
> consequently - I can't process the whole list.
>
> Is this behaviour known - and is there a solution/work around.
>
> If not - how can I "batch" the whole list and catch IntegrityErrors
>
> It is Potgresql database
>
> Thx
> Timothy
>
> >
>


-- 
"Bureaucrat Conrad, you are technically correct -- the best kind of correct."

--~--~---------~--~----~------------~-------~--~----~
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 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to