]> granicus.if.org Git - postgis/commitdiff
Another schema support bug from Mark
authorSandro Santilli <strk@keybit.net>
Thu, 5 Aug 2004 20:00:24 +0000 (20:00 +0000)
committerSandro Santilli <strk@keybit.net>
Thu, 5 Aug 2004 20:00:24 +0000 (20:00 +0000)
git-svn-id: http://svn.osgeo.org/postgis/trunk@665 b70326c6-7e19-0410-871a-916f4a2858ee

loader/shp2pgsql.c

index 42b1baca9b08fce498053c36beddc71417f5c2c7..498ed3c09ea2c0a4c335b95ac43756ff833f9186 100644 (file)
@@ -12,6 +12,9 @@
  * 
  **********************************************************************
  * $Log$
+ * Revision 1.62  2004/08/05 20:00:24  strk
+ * Another schema support bug from Mark
+ *
  * Revision 1.61  2004/08/05 16:53:29  strk
  * schema support patches sent by Mark
  *
@@ -1166,10 +1169,22 @@ int main (int ARGC, char **ARGV){
 
 
        free(col_names);
-       if(opt != 'a'){
-               printf("\nALTER TABLE ONLY \"%s\" ADD CONSTRAINT \"%s_pkey\" PRIMARY KEY (gid);\n",table,table);
-               if(j > 1){
-                       printf("SELECT setval ('\"%s_gid_seq\"', %i, true);\n", table, j-1);
+       if(opt != 'a')
+       {
+               if ( schema )
+               {
+                       printf("\nALTER TABLE ONLY \"%s\".\"%s\" ADD CONSTRAINT \"%s_pkey\" PRIMARY KEY (gid);\n",schema,table,table);
+                       if(j > 1)
+                       {
+                               printf("SELECT setval ('\"%s\".\"%s_gid_seq\"', %i, true);\n", schema, table, j-1);
+                       }
+               }
+               else
+               {
+                       printf("\nALTER TABLE ONLY \"%s\" ADD CONSTRAINT \"%s_pkey\" PRIMARY KEY (gid);\n",table,table);
+                       if(j > 1){
+                               printf("SELECT setval ('\"%s_gid_seq\"', %i, true);\n", table, j-1);
+                       }
                }
        }