PostGIS
3.0.6dev-r@@SVN_REVISION@@
|
int ShpLoaderGetSQLHeader | ( | SHPLOADERSTATE * | state, |
char ** | strheader | ||
) |
TODO: if the table has more then one geometry column the DROP TABLE call will leave spurious records in geometry_columns.
If the geometry column in the table being dropped does not match 'the_geom' or the name specified with -g an error is returned by DropGeometryColumn.
The table to be dropped might not exist.
If we are in dump mode and a transform was asked for need to create a temp table to store original data You may ask, why don't we go straight into the main table and then do an alter table alter column afterwards Main reason is so we don't incur the penalty of WAL logging when we change the typmod in final run.
create a temp table with same structure as main except for no restriction on geometry type
out input data is going to be in different srid from target, so need to remove type constraint
Definition at line 1279 of file shp2pgsql-core.c.
References shp_loader_state::config, shp_loader_config::dump_format, shp_loader_config::encoding, shp_loader_state::field_names, shp_loader_state::from_srid, shp_loader_state::geo_col, shp_loader_config::geography, shp_loader_config::idxtablespace, malloc(), shp_loader_state::num_fields, shp_loader_config::opt, shp_loader_state::pgdims, shp_loader_state::pgfieldtypes, shp_loader_state::pgtype, shp_loader_config::readshape, shp_loader_config::schema, SHPLOADEROK, SRID_UNKNOWN, stringbuffer_aprintf(), stringbuffer_clear(), stringbuffer_create(), stringbuffer_destroy(), stringbuffer_getstring(), shp_loader_config::table, shp_loader_config::tablespace, shp_loader_state::to_srid, shp_loader_state::types, shp_loader_config::usetransaction, and shp_loader_state::widths.
Referenced by pgui_action_import().