Re: Automatic rollback on error, duplicate key?

<[email protected]>
Newsgroups gmane.comp.python.db.pypgsql.user
Message-ID <[email protected]>
Gerhard, thanks for responding so quickly!

> No, that is indeed what's currently going on. I agree it's odd and I
> think it should be changed. The only question is: how exactly should the
> behaviour be? Hmm. Maybe I should look how psycopg implement it.

I just received a note from a friend of mine:

  > You're not going to like the answer you get -- it's not a function of
  > the Python driver, it's the database itself. Postgres treats a duplicate
  > key in a unique index as an error so it rolls back the entire transaction

  > Very lame, I know -- I ran into this when I was setting up
  > . . .
  > . . .
  > This is documented as a possible future enhancement:
  >
  >    http://www.postgresql.org/idocs/index.php?wal.html

Oops. I've done this a lot before, but I guess it was always with
Oracle, and not Postgres. It sounds like there's nothing pypgsql can
do to avoid it?

-Bob




-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.