Re: Transaction management and atomic

2014-09-30 Thread Anssi Kääriäinen
On Wed, 2014-10-01 at 14:31 +1000, Curtis Maloney wrote: > This is primarily a function of the DBMS. When your operations cause > a DB-level error, the DB needs to roll back the transaction to clean > up. This depends on the database. On PostgreSQL, after any error the transaction (or savepoint)

Re: Transaction management and atomic

2014-09-30 Thread Curtis Maloney
This is primarily a function of the DBMS. When your operations cause a DB-level error, the DB needs to roll back the transaction to clean up. If you don't, you're operating on an unknown state. Django can not control this beyond wrapping the "risky" operation in a transaction. Consider -- exact

Transaction management and atomic

2014-09-30 Thread Cristiano Coelho
Hello there, I have recently updated to django 1.7, from 1.5 and one of the main changes I had to do was to replace all deprecated transaction.commit_manually to transaction.atomic, so far so good. After this, I have found out that if an IntegrityError or DatabaseError exception happen inside

Re: RFC: "UPSERT" in PostgreSQL

2014-09-30 Thread Peter Geoghegan
On Tue, Sep 30, 2014 at 12:49 AM, Anssi Kääriäinen wrote: > Both PostgreSQL's proposed documentation and MySQL's > existing documentation warn users that it is a bad idea to use this > feature when multiple unique indexes exists for the table. So, why make > that behavior default? The MySQL docum

Re: RFC: "UPSERT" in PostgreSQL

2014-09-30 Thread Anssi Kääriäinen
On Mon, 2014-09-29 at 10:56 +0300, I wrote: > - Wild suggestion: Maybe it would be better to default to the PRIMARY > KEY index of the table. If no PK index exists, the user must specify > which unique index to use. Maybe there shouldn't be a possibility to > specify more than one unique index?

Re: RFC: "UPSERT" in PostgreSQL

2014-09-30 Thread Peter Geoghegan
On Tue, Sep 30, 2014 at 12:37 AM, Anssi Kääriäinen wrote: > The main point is that having WITHIN PRIMARY KEY syntax would make usage > of this feature a lot easier for us. I was thinking about doing that anyway. -- Peter Geoghegan -- You received this message because you are subscribed to the

Re: RFC: "UPSERT" in PostgreSQL

2014-09-30 Thread Anssi Kääriäinen
On Mon, 2014-09-29 at 11:11 -0600, Carl Meyer wrote: > Of course, it would be better for Django to reliably know index names. > Even though we don't currently, I'm hopeful that > https://github.com/django/deps/pull/6 may get us there by the time we > would be considering these changes anyway, which