Looks like it’s perfectly good, but there still is some crap somewhere that prevent it from working. There must be a reference to that unexisting column “the_geom” somewhere.

What’s in your geometry_columns table ?

Mine is :

select * from geometry_columns;
 f_table_catalog | f_table_schema |    f_table_name    | f_geometry_column | coord_dimension |  srid  |      type
-----------------+----------------+--------------------+-------------------+-----------------+--------+-----------------
                 | public         | cfd                | way               |               2 |     -1 | MULTILINESTRING
                 | public         | planet_osm_point   | way               |               2 | 900913 | POINT
                 | public         | planet_osm_line    | way               |               2 | 900913 | LINESTRING
                 | public         | planet_osm_polygon | way               |               2 | 900913 | POLYGON
                 | public         | planet_osm_roads   | way               |               2 | 900913 | LINESTRING