From: Sandro Santilli Date: Wed, 6 Apr 2005 14:16:43 +0000 (+0000) Subject: Removed manual update of gid field. X-Git-Tag: pgis_1_0_0~21 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a6581d22ac30f5867eab9483956bf180f8e365f8;p=postgis Removed manual update of gid field. git-svn-id: http://svn.osgeo.org/postgis/trunk@1601 b70326c6-7e19-0410-871a-916f4a2858ee --- diff --git a/loader/shp2pgsql.c b/loader/shp2pgsql.c index 0dad9cd39..7454e569a 100644 --- a/loader/shp2pgsql.c +++ b/loader/shp2pgsql.c @@ -60,7 +60,7 @@ int dump_format = 0; //0=insert statements, 1 = dump int quoteidentifiers = 0; int forceint4 = 0; char opt = ' '; -char *col_names; +char *col_names = NULL; char *pgtype; int istypeM = 0; int pgdims; @@ -109,7 +109,7 @@ void ReleasePolygons(Ring **polys, int npolys); void DropTable(char *schema, char *table, char *geom); void GetFieldsSpec(void); void LoadData(void); -void UpdateSerials(void); +void UpdateSequence(void); void OpenShape(void); void LowerCase(char *s); void Cleanup(void); @@ -398,11 +398,6 @@ main (int ARGC, char **ARGV) */ if(opt != 'p') LoadData(); - /* - * If not in 'append' mode update sequence numbering - */ - if(opt != 'a' && opt != 'p') UpdateSerials(); - printf("END;\n"); // End the last transaction @@ -453,8 +448,11 @@ OpenShape(void) } +/* + * Not used + */ void -UpdateSerials(void) +UpdateSequence(void) { if ( schema ) { @@ -619,17 +617,6 @@ LoadData(void) printf("INSERT INTO \"%s\" %s VALUES (", table, col_names); } - if(opt != 'a') - { - printf("'%d',", j); - } - } - else - { - if(opt != 'a') - { - printf("%d\t", j); - } } Insert_attributes(hDBFHandle,j); @@ -1507,11 +1494,7 @@ GetFieldsSpec(void) widths = malloc(num_fields*sizeof(int)); precisions = malloc(num_fields*sizeof(int)); col_names = malloc((num_fields+2) * sizeof(char) * 32); - if(opt != 'a'){ - strcpy(col_names, "(gid," ); - }else{ - strcpy(col_names, "(" ); - } + strcpy(col_names, "(" ); //fprintf(stderr, "Number of fields from DBF: %d\n", num_fields); for(j=0;j