Ticket #490 (new defect)

Opened 3 years ago

Last modified 3 years ago

SQLAlchemy cannot create Tables containing Geometry columns

Reported by: paul Owned by: elemoine
Priority: critical Milestone: 1.3 Release
Component: framework.server Version: SVN
Keywords: Cc:
State:

Description

When creating a table using SQLAlchemy, which contains an Geometry Attribute as defined in sqlalchemygeom.py, Postges 8.3 rejects the Create statement.

The SQL Statement generated by SQLAlchemy is:

CREATE TABLE mapmatch_result (
        id SERIAL NOT NULL,
        edge_id INTEGER,
        projected_vertex GEOMETRY(), <--- ERROR HERE
        PRIMARY KEY (id)
)

The String 'GEOMETRY()' is returned from here trunk/MapFish/server/python/mapfish/sqlalchemygeom.py#L76

returning 'GEOMETRY' instead solves the create table issue, at least for Create Table statements

Change History

Changed 3 years ago by elemoine

yes, with today's code we cannot have SQLAlchemy create tables with geometry columns, this is a known issue.

Does your proposed change really solve the issue? The common way to create tables with geometry columns involves using PostGIS' Add Geometry Column? function, so I think we should register some hook function to properly do the work.

The SQLAlchemy code base includes an interesting postgis.py example.

Changed 3 years ago by elemoine

  • milestone set to 1.3 Release
Note: See TracTickets for help on using tickets.