[snip] > When I use this with my table and datamapper code, it looks like > everything is working fine but the generated SQL insert statement > fails with a exception: > > sqlalchemy.exceptions.SQLError: (ProgrammingError) parse error - > invalid geometry > 'INSERT INTO gis_entity (id, name, pos) VALUES (%(mId)s, %(mName)s, > %(mPos)s)' {'mName': 'New entity', 'mId': 1L, 'mPos': > "GeomFromText('POINT(100 100)',-1)"} > > I know from using sql directly in pgadmin3 that this line works correctly: > > insert into gis_entity (id, name, pos) values (2, 'New entity', > GeomFromText('POINT(100 100)', -1)); > > Does anyone see how this varies from the sql statement issued by SA?
By looking at the postgres log I figured out what was causing the error, but I still don't know how to fix it. The problem is that SA considers "GeomFromText('POINT(100 100)', -1)" to be a string so it puts it in single quotes when creating the SQL command to execute. This causes problems because them postgres doesn't know it could be calling a method instead. I have tried returning an sqlalchemy.func object but this doesn't work either. Any ideas? -Allen --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To post to this group, send email to sqlalchemy@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en -~----------~----~----~----~------~----~------~--~---