/*
  Combine the sf1_blocks and tiger_blocks tables into one
  comprehensive "blocks" table. Once we're done, we drop
  sf1_blocks and tiger_blocks.
*/
INSERT INTO blocks
       (SELECT sf1_blocks.id,
	       sf1_blocks.state,
       	       sf1_blocks.county,
	       sf1_blocks.tract,
	       sf1_blocks.block,
	       sf1_blocks.blkidfp00,
	       sf1_blocks.pop100,
	       sf1_blocks.total_area,
	       sf1_blocks.population_density,
	       tiger_blocks.the_geom
	FROM sf1_blocks INNER JOIN tiger_blocks
	     		ON sf1_blocks.blkidfp00 = tiger_blocks.blkidfp00);

DROP TABLE sf1_blocks;
DROP TABLE tiger_blocks;

/* We have to re-create the GiST index on the new table as well. */
CREATE INDEX idx_geometry_gist ON blocks USING gist(the_geom);
