]> granicus.if.org Git - postgis/commitdiff
schema support patches sent by Mark
authorSandro Santilli <strk@keybit.net>
Thu, 5 Aug 2004 16:53:29 +0000 (16:53 +0000)
committerSandro Santilli <strk@keybit.net>
Thu, 5 Aug 2004 16:53:29 +0000 (16:53 +0000)
git-svn-id: http://svn.osgeo.org/postgis/trunk@663 b70326c6-7e19-0410-871a-916f4a2858ee

loader/pgsql2shp.c
loader/shp2pgsql.c

index 8293459818d15d8fa85c025d8fef8aab58000417..122e0ff425b287df1668c61d4d11fb7573f8eaaa 100644 (file)
@@ -10,6 +10,9 @@
  * 
  **********************************************************************
  * $Log$
+ * Revision 1.53  2004/08/05 16:53:29  strk
+ * schema support patches sent by Mark
+ *
  * Revision 1.52  2004/06/16 13:42:05  strk
  * Added schema support in getMaxFieldSize.
  * Added direct support for TIMESTAMP field types (thanks to Steffen Macke).
@@ -2393,6 +2396,7 @@ initialize()
                sprintf(query, "SELECT a.attname, a.atttypid, a.attlen FROM "
                        "pg_attribute a, pg_class c, pg_namespace n WHERE "
                        "n.nspname = '%s' AND a.attrelid = c.oid AND "
+                       "n.oid = c.relnamespace AND "
                        "a.atttypid != 0 AND "
                        "a.attnum > 0 AND c.relname = '%s'", schema, table);
        }
index 564d4fd5ccd682813a9bc8b721fdffe6659d123b..42b1baca9b08fce498053c36beddc71417f5c2c7 100644 (file)
@@ -12,6 +12,9 @@
  * 
  **********************************************************************
  * $Log$
+ * Revision 1.61  2004/08/05 16:53:29  strk
+ * schema support patches sent by Mark
+ *
  * Revision 1.60  2004/07/29 14:10:37  strk
  * Unability to open a shapefile or dbffile reported more nicely.
  *
@@ -921,8 +924,16 @@ int main (int ARGC, char **ARGV){
 
                if (!dump_format)
                {
-                       printf("INSERT INTO \"%s\" %s VALUES ('%d',",
+                       if ( schema )
+                       {
+                               printf("INSERT INTO \"%s\".\"%s\" %s VALUES ('%d',",
+                                        schema, table, col_names, j);
+                       }
+                       else
+                       {
+                               printf("INSERT INTO \"%s\" %s VALUES ('%d',",
                                        table, col_names, j);
+                       }
                }
                else
                {