Re: Syncdb Error With Oracle Database - IntegrityError Exception

2012-08-31 Thread Jon Blake
Thanks, Ian, I did miss that. Bookmarked for future reference.

On Saturday, September 1, 2012 3:16:38 PM UTC+10, Ian wrote:
>
> On Fri, Aug 31, 2012 at 10:03 PM, Jon Blake > 
> wrote: 
> > 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... 
>
> Yes, please see: 
>
> https://docs.djangoproject.com/en/1.4/ref/databases/#oracle-notes 
>

-- 
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/-/cs7WQZmkJGQJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Syncdb Error With Oracle Database - IntegrityError Exception

2012-08-31 Thread Jon Blake
I've just dropped and re-created my user account with required privileges, 
and all has gone as expected. Table auth_permission has 18 rows.

At the point where I'm prompted to create a superuser account, I made the 
mistake of resizing my terminal window, which resulted in exception 
EOFError being raised on the call to raw_input() in procedure 
create_superuser(). Sigh, and start again... This exception can be handled 
by calling raw_input() in a try block, and handling exception EOFError by 
(for example) shifting the cursor up one row by printing chr(27) +'[A' . 
HTH.

Again, many thanks. I'm on my way with Django - looking like a great 
framework!
  Jon

On Saturday, September 1, 2012 2:03:42 PM UTC+10, Jon Blake wrote:
>
> 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/-/MrFmP3gYrF0J.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Syncdb Error With Oracle Database - IntegrityError Exception

2012-08-31 Thread Ian Kelly
On Fri, Aug 31, 2012 at 10:03 PM, Jon Blake  wrote:
> 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...

Yes, please see:

https://docs.djangoproject.com/en/1.4/ref/databases/#oracle-notes

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



Re: Syncdb Error With Oracle Database - IntegrityError Exception

2012-08-31 Thread Jon Blake
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+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Syncdb Error With Oracle Database - IntegrityError Exception

2012-08-31 Thread Ian
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/-/BKHoqoZkF6oJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Syncdb Error With Oracle Database - IntegrityError Exception

2012-08-30 Thread Amyth Arora
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
.

On Fri, Aug 31, 2012 at 7:17 AM, Jon Blake  wrote:

> Just discovered Django and trying out the Django 1.4 tutorial with an
> Oracle backend database. In my database, I have created user django with
> privs create session, create table, create sequence, create trigger. The
> DATABASES dictionary in settings has been edited to set the default
> settings to the Oracle engine, and the database name, user and password
> specified.
>
> When I run:
>
> $ python manage.py syncdb
>
> I see tables are created, but I also get a traceback ending with:
>
> File "/usr/lib/python2.7/site-packages/django/db/backends/oracle/base.py",
> line 675, in execute
> return self.cursor.execute(query, self._param_generator(params))
> django.db.utils.IntegrityError: ORA-01400: cannot insert NULL into
> ("DJANGO"."AUTH_PERMISSION"."ID")
>
> I did not see a prompt to create a superuser account.
>
> Oracle SQL*Developer shows that schema django contains 9 tables (including
> auth_permission), 16 indexes, 7 triggers and 8 sequences. Table
> django_content_type contains three rows, and the others are empty.
>
> Can anyone advise on how to resolve the ORA-01400 error?
>
> Run-time environment:
>   O/S: Fedora 14
>   Django: 1.4.1
>   Python: 2.7
>   DB: Oracle Database 11.1.0.6.0
>   cx_Oracle client: 11.1.0.6.0
>
>
>
>  --
> 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/-/O5XePWI1ee4J.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>



-- 
Thanks & Regards


Amyth [Admin - Techstricks]
Email - aroras.offic...@gmail.com, ad...@techstricks.com
Twitter - @a_myth_
http://techstricks.com/

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