You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello! I've run into a perms error, which blocks my script from executing the copy in a Django management:
django.db.utils.ProgrammingError: must be superuser to COPY to or from a file
I'm running:
OS 10.10.5
Python 2.7.4
Django 1.9
current version of django-postgres-copy
Thanks!
$ ./manage.py <my_management_command>
Loading <file>.csv.
Loading CSV to <model>
Traceback (most recent call last):
File "./manage.py", line 10, in <module>
execute_from_command_line(sys.argv)
File "/<my>/<path>/.virtualenvs/mccelections/lib/python2.7/site-packages/django/core/management/__init__.py", line 350, in execute_from_command_line
utility.execute()
File "/<my>/<path>/.virtualenvs/mccelections/lib/python2.7/site-packages/django/core/management/__init__.py", line 342, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/<my>/<path>/.virtualenvs/mccelections/lib/python2.7/site-packages/django/core/management/base.py", line 348, in run_from_argv
self.execute(*args, **cmd_options)
File "/<my>/<path>/.virtualenvs/mccelections/lib/python2.7/site-packages/django/core/management/base.py", line 399, in execute
output = self.handle(*args, **options)
File "/<my>/<path>/<to>/<dir>/<djangoproject>/<djangoapp>/management/commands/<my_management_command>", line 57, in handle
c.save()
File "/<my>/<path>/.virtualenvs/mccelections/lib/python2.7/site-packages/postgres_copy/__init__.py", line 86, in save
cursor.execute(copy_sql)
File "/<my>/<path>/.virtualenvs/mccelections/lib/python2.7/site-packages/django/db/backends/utils.py", line 79, in execute
return super(CursorDebugWrapper, self).execute(sql, params)
File "/<my>/<path>/.virtualenvs/mccelections/lib/python2.7/site-packages/django/db/backends/utils.py", line 64, in execute
return self.cursor.execute(sql, params)
File "/<my>/<path>/.virtualenvs/mccelections/lib/python2.7/site-packages/django/db/utils.py", line 95, in __exit__
six.reraise(dj_exc_type, dj_exc_value, traceback)
File "/<my>/<path>/.virtualenvs/mccelections/lib/python2.7/site-packages/django/db/backends/utils.py", line 62, in execute
return self.cursor.execute(sql)
django.db.utils.ProgrammingError: must be superuser to COPY to or from a file
HINT: Anyone can COPY to stdout or from stdin. psql's \copy command also works for anyone.
The text was updated successfully, but these errors were encountered:
I haven't run into this before, but my gut is to guess it's a lower-level permissions issue with either your postgres user, or your system user. Have you worked through suggestions like this?
Hello! I've run into a perms error, which blocks my script from executing the copy in a Django management:
django.db.utils.ProgrammingError: must be superuser to COPY to or from a file
I'm running:
Thanks!
The text was updated successfully, but these errors were encountered: