]> granicus.if.org Git - postgis/commitdiff
Removed manual update of gid field.
authorSandro Santilli <strk@keybit.net>
Wed, 6 Apr 2005 14:16:43 +0000 (14:16 +0000)
committerSandro Santilli <strk@keybit.net>
Wed, 6 Apr 2005 14:16:43 +0000 (14:16 +0000)
git-svn-id: http://svn.osgeo.org/postgis/trunk@1601 b70326c6-7e19-0410-871a-916f4a2858ee

loader/shp2pgsql.c

index 0dad9cd3997f3498ac6bd1bb316204692ee2950b..7454e569a31780fc35d3ba32ea61b9b82916af4a 100644 (file)
@@ -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<num_fields;j++)
@@ -1630,6 +1613,9 @@ utf8 (const char *fromcode, char *inputbuf)
 
 /**********************************************************************
  * $Log$
+ * Revision 1.87  2005/04/06 14:16:43  strk
+ * Removed manual update of gid field.
+ *
  * Revision 1.86  2005/04/06 14:02:08  mschaber
  * added -p option (prepare mode) that spits out the table schema without
  * inserting any data.