Django和Redshift inspectdb需要超级用户

时间:2015-09-11 21:37:20

标签: python django postgresql django-models amazon-redshift

我的redshift数据库一直出错,我似乎无法在数据库上运行./manage.py inspectdb命令。

我从pg_user做了一个select *,并验证我的用户是超级用户。

仍然不确定为什么会出现此问题,https://forums.aws.amazon.com/thread.jspa?threadID=133514这是问题的旧链接。

错误: django.db.utils.ProgrammingError:必须是超级用户才能检查" max_index_keys" 语境:SQL函数" _pg_keypositions"声明1

错误日志:

Traceback (most recent call last):  

File "manage.py", line 10, in <module>
    execute_from_command_line(sys.argv)

  File "/webapps/hello_django/local/lib/python2.7/site-packages/django/core/mana                                                                                                                                                             gement/__init__.py", line 338, in execute_from_command_line
    utility.execute()
  File "/webapps/hello_django/local/lib/python2.7/site-packages/django/core/mana                                                                                                                                                             gement/__init__.py", line 330, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/webapps/hello_django/local/lib/python2.7/site-packages/django/core/mana                                                                                                                                                             gement/base.py", line 393, in run_from_argv
    self.execute(*args, **cmd_options)
  File "/webapps/hello_django/local/lib/python2.7/site-packages/django/core/mana                                                                                                                                                             gement/base.py", line 444, in execute
    output = self.handle(*args, **options)
  File "/webapps/hello_django/local/lib/python2.7/site-packages/django/core/mana                                                                                                                                                             gement/commands/inspectdb.py", line 25, in handle
    for line in self.handle_inspection(options):
  File "/webapps/hello_django/local/lib/python2.7/site-packages/django/core/mana                                                                                                                                                             gement/commands/inspectdb.py", line 72, in handle_inspection
    constraints = connection.introspection.get_constraints(cursor, table_name)
  File "/webapps/hello_django/local/lib/python2.7/site-packages/django/db/backen                                                                                                                                                             ds/postgresql_psycopg2/introspection.py", line 187, in get_constraints
    """, ["public", table_name])
  File "/webapps/hello_django/local/lib/python2.7/site-packages/django/db/backen                                                                                                                                                             ds/utils.py", line 79, in execute
    return super(CursorDebugWrapper, self).execute(sql, params)
  File "/webapps/hello_django/local/lib/python2.7/site-packages/django/db/backen                                                                                                                                                             ds/utils.py", line 64, in execute
    return self.cursor.execute(sql, params)
  File "/webapps/hello_django/local/lib/python2.7/site-packages/django/db/utils.                                                                                                                                                             py", line 97, in __exit__
    six.reraise(dj_exc_type, dj_exc_value, traceback)
  File "/webapps/hello_django/local/lib/python2.7/site-packages/django/db/backen                                                                                                                                                             ds/utils.py", line 64, in execute
    return self.cursor.execute(sql, params)
django.db.utils.ProgrammingError: must be superuser to examine "max_index_keys"
CONTEXT:  SQL function "_pg_keypositions" statement 1

0 个答案:

没有答案
相关问题