Ver código fonte

v.db.addtable: add schema to table name if schema exists

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@56701 15284696-431f-4ddb-bdfa-cd5b030d7da7
Markus Metz 12 anos atrás
pai
commit
efe2be9296
1 arquivos alterados com 3 adições e 0 exclusões
  1. 3 0
      scripts/v.db.addtable/v.db.addtable.py

+ 3 - 0
scripts/v.db.addtable/v.db.addtable.py

@@ -87,6 +87,7 @@ def main():
     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 @@ def main():
             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)