Friday, August 31, 2012

Re: Syncdb Error With Oracle Database - IntegrityError Exception

Thanks, Ian and Amyth, for your responses.

I encountered the CREATE TRIGGER privilege issue early in my trials with Django with the Oracle database back end - Django propagated an Oracle "insufficient privileges" exception. That was quickly sorted by granting the required privilege to my user account.

On looking at ticket #17015 you pointed me to, it looks like I might have stumbled over the same issue as in the reply to ikelly. My user did not have the CREATE TRIGGER privilege the first time I tried to run syncdb, but did have the CREATE_TABLE and CREATE_SEQUENCE privileges. After granting the missing privilege and running syncdb again, I then got the ORA-01400 exception on table auth_permission.

I'm guessing that the first table that oracle back end base.py creates is auth_permission, and that the table and its primary key sequence were successfully created, because the user had the required privileges. Module base.py then terminated on attempting to create the trigger for the table. After granting CREATE TRIGGER and running syncdb again, base.py noted that table auth_permission exists, so nothing more needed to be done for that table. Module base.py then went on and created the remaining tables, sequences and triggers. Missing trigger auth_permission_tr -> no primary key raised from auth_permission_sq -> ORA-01400 on table auth_permission inserts.

Querying column timestamp of view user_objects for tables, sequences and triggers appears to confirm my understanding of what base.py does. I'll drop and recreate my user account, and try again. I'll advise how this goes. Does the Django doco have any specific documentation for the Oracle back end? If so, I missed it! I'm happy to provide specific doco for the Oracle back end if that would assist...

Once again, many thanks

Jon


On Saturday, September 1, 2012 1:23:28 AM UTC+10, Ian wrote:
On Friday, August 31, 2012 12:10:54 AM UTC-6, Amyth wrote:
Hey Jon,

I guess this is because of a bug in django. Django already has a open ticket for this bug. Check it out here


As described in that ticket, the reason for the problem is probably just that the Django user does not have the CREATE TRIGGER privilege, which it needs.  The bug in Django is just that this condition is not detected and reported at the time the table is created, instead of getting a rather more obscure error message at the time the table is populated.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/LXuXcxvnlnkJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

No comments:

Post a Comment