[GRASS-SVN] r56701 - grass/trunk/scripts/v.db.addtable

svn_grass at osgeo.org svn_grass at osgeo.org
Fri Jun 14 03:52:10 PDT 2013


Author: mmetz
Date: 2013-06-14 03:52:10 -0700 (Fri, 14 Jun 2013)
New Revision: 56701

Modified:
   grass/trunk/scripts/v.db.addtable/v.db.addtable.py
Log:
v.db.addtable: add schema to table name if schema exists

Modified: grass/trunk/scripts/v.db.addtable/v.db.addtable.py
===================================================================
--- grass/trunk/scripts/v.db.addtable/v.db.addtable.py	2013-06-14 10:24:21 UTC (rev 56700)
+++ grass/trunk/scripts/v.db.addtable/v.db.addtable.py	2013-06-14 10:52:10 UTC (rev 56701)
@@ -87,6 +87,7 @@
     kv = grass.db_connection()
     database = kv['database']
     driver = kv['driver']
+    schema = kv['schema']
     
     # maybe there is already a table linked to the selected layer?
     nuldev = file(os.devnull, 'w')
@@ -119,6 +120,8 @@
             grass.fatal(_("Unable to create table <%s>") % table)
     
     # connect the map to the DB:
+    if schema is not '':
+        table = '%s.%s' (schema, table)
     grass.run_command('v.db.connect', quiet = True,
                       map = map_name, database = database, driver = driver,
 		      layer = layer, table = table, key = key)



More information about the grass-commit mailing list