composite primary keys and transaction issue

7 views
Skip to first unread message

imgrey

unread,
Nov 22, 2012, 12:35:39 PM11/22/12
to django...@googlegroups.com
Since django do not support composite primary keys, I'm forced to use plain SQL queries.

I got two databases defined and when I try to use UPDATE or INSERT, it simply do nothing:

        cursor = connections['foods'].cursor()
        cursor.execute(sql)

I tried transaction.commit()
cursor.db.set_dirty()
transaction.commit_unless_managed()

Nothing helps. Data not saved in database.

I checked if SQL was valid by executing query through postgres shell. It executed successfully.


P.S. I got the following index defined:

    "MeasureWeight_pkey" PRIMARY KEY, btree ("foodCode", measure, amount, "weightGm")


Reply all
Reply to author
Forward
0 new messages