I didn't try the actual code, but CREATE INDEX foo_idx ON foo USING GIST (""GEOM"") produces a zero-length identifier error here.  self._quote already adds the quotes, doesn't it?