How to support to connect GreenPlum with the 'django.db.backends.postgresql_psycopg2' ?

330 views
Skip to first unread message

Ruping Wang

unread,
May 8, 2016, 6:57:41 AM5/8/16
to Django users
Hello,

I got an error when I tried to utilize the 'django.db.backends.postgresql_psycopg2' to connect Greenplum.Given,The Greenplum is based on PostgreSQL to develop and Djando's backend support to connect PostgreSQL,so I guess it should be support Greenplum to connect.After I modified the database configuration and executed the command like 
 python manage.py syncdb --noinput
I got an error as following: 
$ python manage.py syncdb --noinput
Syncing...
Creating tables ...
Creating table auth_permission
Traceback (most recent call last):
  File "manage.py", line 11, in <module>
    execute_from_command_line(sys.argv)
  File "/usr/lib/python2.7/site-packages/django/core/management/__init__.py", line 443, in execute_from_command_line
    utility.execute()
  File "/usr/lib/python2.7/site-packages/django/core/management/__init__.py", line 382, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/usr/lib/python2.7/site-packages/django/core/management/base.py", line 196, in run_from_argv
    self.execute(*args, **options.__dict__)
  File "/usr/lib/python2.7/site-packages/django/core/management/base.py", line 232, in execute
    output = self.handle(*args, **options)
  File "/usr/lib/python2.7/site-packages/django/core/management/base.py", line 371, in handle
    return self.handle_noargs(**options)
  File "/usr/lib/python2.7/site-packages/south/management/commands/syncdb.py", line 90, in handle_noargs
    syncdb.Command().execute(**options)
  File "/usr/lib/python2.7/site-packages/django/core/management/base.py", line 232, in execute
    output = self.handle(*args, **options)
  File "/usr/lib/python2.7/site-packages/django/core/management/base.py", line 371, in handle
    return self.handle_noargs(**options)
  File "/usr/lib/python2.7/site-packages/django/core/management/commands/syncdb.py", line 102, in handle_noargs
    cursor.execute(statement)
  File "/usr/lib/python2.7/site-packages/django/db/backends/util.py", line 40, in execute
    return self.cursor.execute(sql, params)
  File "/usr/lib/python2.7/site-packages/django/db/backends/postgresql_psycopg2/base.py", line 52, in execute
    return self.cursor.execute(query, args)
django.db.utils.DatabaseError: Greenplum Database does not allow having both PRIMARY KEY and UNIQUE constraints

I found it didn't work when I removed all UNIQUE constraints statements.So I want to get some proposals what to modify to support greenplum!
Thank you!




Vincent Pemberton

unread,
Sep 7, 2018, 6:36:00 AM9/7/18
to Django users
Hi Ruping,

I realise you posted this over two years ago but my company is trying to integrate Django with Greenplum for a small project. I more or less believe it isn't possible without changing Django's own code (which we strictly do not want to do) so I'm wondering if you ever got it to work, and if so, could you please summarise how?

Sorry I cannot be of any help (two years down the line).

Regards,
Vinny
Reply all
Reply to author
Forward
0 new messages