I'm trying to delete through a cursor like this:
from django.db import models, connection, transaction
cursor = connection.cursor()
cursor.execute( query )
But it appears to not be committing. I suspect this because the change
doesn't register, and when I try to do the same delete from the
postgres command line, it doesn't complete until I close python (so i
figure it is releasing a lock or something).
Ok, just solved it actually...
I looked in the db wrapping and tried calling connection._commit().
Since its a private attribute, I assume I'm doing something wrong
though. Is that the case?
Thanks,
Steve
Looks like you might be getting caught up on transactions.
transaction.commit()
will commit all the executed statements to the database. It is
effectively just a call to connection._commit(), plus some other
transaction-related housekeeping.
Yours,
Russ Magee %-)
is it possible that custom inserts in postgres require an explicit
call to commit, even when not under transaction? If thats the case,
then perhaps connection._commit() shouldn't private. If not, then I'm
still uncertain :)
Best,
Steve