Opened 9 years ago

Closed 9 years ago

#24180 closed Bug (invalid)

Table created incorrectly on AddGeometryColumn error

Reported by: Manel Clos Owned by: nobody
Component: GIS Version: 1.7
Severity: Normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

Hi, when using 'manage.py migrate' and an error happens creating the geometry column, the new table will be incorrectly created with the geometry field missing.

  Creating tables...
    Creating table myapp_mymodel
  Installing custom SQL...
  Installing indexes...
    Failed to install index for myapp.MyModel model: permission denied for relation spatial_ref_sys
CONTEXT:  SQL statement "SELECT SRID FROM spatial_ref_sys WHERE SRID =  $1 "
PL/pgSQL function "addgeometrycolumn" line 74 at SQL statement
SQL statement "SELECT AddGeometryColumn('','', $1 , $2 , $3 , $4 , $5 )"
PL/pgSQL function "addgeometrycolumn" line 5 at SQL statement

Running 'manage.py migrate' again:

Operations to perform:
  Synchronize unmigrated apps: gis, myapp
  Apply all migrations: contenttypes, sites, auth, sessions
Synchronizing apps without migrations:
  Creating tables...
  Installing custom SQL...
  Installing indexes...
Running migrations:
  No migrations to apply.
  Your models have changes that are not yet reflected in a migration, and so won't be applied.
  Run 'manage.py makemigrations' to make new migrations, and then re-run 'manage.py migrate' to apply them.

Change History (2)

comment:1 by Tim Graham, 9 years ago

I am not sure what the expected behavior you are looking for is?

comment:2 by Claude Paroz, 9 years ago

Resolution: invalid
Status: newclosed

That's a permission problem in your database. The database user configured in the DATABASES setting must be able to select from spatial_ref_sys and call AddGeometryColumn.

Note: See TracTickets for help on using tickets.
Back to Top