manishy635 / django-cron

Automatically exported from code.google.com/p/django-cron
MIT License
0 stars 0 forks source link

syncdb table creation fails using postgresql + psycopg2 #16

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Use Django 1.0.2, Python 2.6, and current django-cron.  Add the
django_cron to INSTALLED_APPS for a postgresql 8.3 + psycopg2 database.
2. Run python manage.py syncdb

What is the expected output? What do you see instead?
1. Database tables should be created.  Instead table creation will fail
with the following errors:
Traceback (most recent call last):
  File "manage.py", line 11, in <module>
    execute_manager(settings)
  File
"/var/lib/python-support/python2.6/django/core/management/__init__.py",
line 340, in execute_manager
    utility.execute()
  File
"/var/lib/python-support/python2.6/django/core/management/__init__.py",
line 295, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/var/lib/python-support/python2.6/django/core/management/base.py",
line 192, in run_from_argv
    self.execute(*args, **options.__dict__)
  File "/var/lib/python-support/python2.6/django/core/management/base.py",
line 219, in execute
    output = self.handle(*args, **options)
  File "/var/lib/python-support/python2.6/django/core/management/base.py",
line 348, in handle
    return self.handle_noargs(**options)
  File
"/var/lib/python-support/python2.6/django/core/management/commands/syncdb.py",
line 54, in handle_noargs
    tables = connection.introspection.table_names()
  File "/var/lib/python-support/python2.6/django/db/backends/__init__.py",
line 390, in table_names
    return self.get_table_list(cursor)
  File
"/var/lib/python-support/python2.6/django/db/backends/postgresql/introspection.p
y",
line 29, in get_table_list
    AND pg_catalog.pg_table_is_visible(c.oid)""")
  File "/var/lib/python-support/python2.6/django/db/backends/util.py", line
19, in execute
    return self.cursor.execute(sql, params)
psycopg2.InternalError: current transaction is aborted, commands ignored
until end of transaction block

What version of the product are you using? On what operating system?
Current read-only source as of 12:00PM 6/15/2009 on Ubuntu server 9.

Please provide any additional information below.
I can be reached at jchampion@zetacentauri.com if you need any additional
information.

Original issue reported on code.google.com by jchampio...@gtempaccount.com on 15 Jun 2009 at 7:25

GoogleCodeExporter commented 8 years ago
I got this working by changing the model name to Jobb from Job.  Perhaps 
something in
the table name or sequence name boils down to a conflicting name in postgre?

Anyway, the hack I'm using is to rename the class, which obviously affects the 
table
name and such, but then add this in the models.py as well:

Job = Jobb

Original comment by rcather...@gmail.com on 9 Jul 2009 at 6:43

GoogleCodeExporter commented 8 years ago
This is very interesting... perhaps a better name to use is CronJob, I'll look 
into
fixing that bug without breaking backwards compatibility

Original comment by Jim.mixt...@gmail.com on 15 Jul 2009 at 12:38

GoogleCodeExporter commented 8 years ago
Marking as accepted

Original comment by Jim.mixt...@gmail.com on 15 Jul 2009 at 12:39

GoogleCodeExporter commented 8 years ago
Any news on this item?

Original comment by ninethval@gmail.com on 12 Aug 2009 at 4:52

GoogleCodeExporter commented 8 years ago
^^ yeah any news? I really want to use this app, but i'm using psygopg2 so no 
worky :(

Original comment by nbvF...@gmail.com on 23 Aug 2009 at 11:56

GoogleCodeExporter commented 8 years ago
I don't think this is an issue anymore, but I could be wrong. Please let me 
know if
anyone gets it. Marking as fixed (Will re-open if anyone still has the problem)

Original comment by Jim.mixt...@gmail.com on 17 Sep 2009 at 1:03