| 134 | Alter table clip_troncon set schema rht; |
| 135 | DROP TABLE IF EXISTS bd_carthage2011.troncon_bv; |
| 136 | CREATE TABLE bd_carthage2011.troncon_bv AS |
| 137 | select bdc.* from bd_carthage2011.troncon_hydrographique bdc, rht.clip_troncon as clip where st_contains(clip.the_geom,bdc.the_geom)=true; |
| 138 | ALTER TABLE bd_carthage2011.troncon_bv ADD CONSTRAINT pk_id_bdcarth_bv PRIMARY KEY (gid); |
| 139 | INSERT INTO geometry_columns(f_table_catalog, f_table_schema, f_table_name, f_geometry_column, coord_dimension, srid, "type") |
| 140 | SELECT '', 'bd_carthage2011', 'troncon_bv', 'the_geom', ST_CoordDim(the_geom), ST_SRID(the_geom), GeometryType(the_geom) |
| 141 | FROM bd_carthage2011.troncon_bv LIMIT 1; |
| 143 | DROP TABLE IF EXISTS rht.rht_bv; |
| 144 | CREATE TABLE rht.rht_bv AS |
| 145 | SELECT r.* FROM rht.rht r, rht.clip_troncon as clip where st_contains(clip.the_geom,r.the_geom)=true; |
| 146 | ALTER TABLE rht.rht_bv ADD CONSTRAINT pk_id_drain_rht_bv PRIMARY KEY (id_drain); |
| 147 | INSERT INTO geometry_columns(f_table_catalog, f_table_schema, f_table_name, f_geometry_column, coord_dimension, srid, "type") |
| 148 | SELECT '', 'rht', 'rht_bv', 'the_geom', ST_CoordDim(the_geom), ST_SRID(the_geom), GeometryType(the_geom) |
| 149 | FROM rht.rht_bv LIMIT 1; |