   END IF;
 
   -- If mercgeom is the wrong name, just rename it.
-  IF gc.has_mercgeom AND gc.has_mercgeom_name != const.mercgeomcol THEN  
+  IF gc.has_mercgeom AND gc.has_mercgeom_name != const.mercgeomcol THEN
     sql := Format('ALTER TABLE %I DROP COLUMN IF EXISTS %I', reloid::text, const.mercgeomcol);
     PERFORM _CDB_SQL(sql,'_CDB_Rewrite_Table');
     sql := Format('ALTER TABLE %s RENAME COLUMN %s TO %s', reloid::text, gc.has_mercgeom_name, const.mercgeomcol);

$$ LANGUAGE 'plpgsql';


CREATE OR REPLACE FUNCTION _CDB_Has_Usable_Geom(reloid REGCLASS)
RETURNS RECORD
AS $$
DECLARE
  r1 RECORD;

  -- indexes are in place and apply a rename
  SELECT *
  FROM _CDB_Has_Usable_Geom(reloid) 
  INTO STRICT gc;

  -- If geom is the wrong name, just rename it.
