I am trying to migrate with the following RunSQL command:
class Migration(migrations.Migration): operations = [ RunSQL( r''' COPY auth_group (id, name) FROM stdin; 1 TEST-GROUP \. ''')]
This is not true:
File "/home/foo/local/lib/python2.7/site-packages/django/db/backends/utils.py", line 63, in execute return self.cursor.execute(sql) django.db.utils.ProgrammingError: syntax error at or near "1" LINE 3: 1 TEST-GROUP
Does COPY exist in RunSQL ?
We use psycopg2
django postgresql database-migration psycopg2
guettli
source share