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

Markus Neteler neteler at osgeo.org
Sat Jan 26 04:38:55 PST 2019


Hi,

On Tue, Jan 22, 2019 at 3:51 AM <svn_grass at osgeo.org> wrote:
>
> Author: hcho
> Date: 2019-01-21 18:51:33 -0800 (Mon, 21 Jan 2019)
> New Revision: 73995
>
> Modified:
>    grass/trunk/scripts/v.db.addtable/v.db.addtable.py
> Log:
> v.db.addtable: Do not create unique index from this script; v.db.connect will try to create it again causing some drivers to fail (PostgreSQL)
>
> Modified: grass/trunk/scripts/v.db.addtable/v.db.addtable.py
> ===================================================================
> --- grass/trunk/scripts/v.db.addtable/v.db.addtable.py  2019-01-21 22:37:59 UTC (rev 73994)
> +++ grass/trunk/scripts/v.db.addtable/v.db.addtable.py  2019-01-22 02:51:33 UTC (rev 73995)
> @@ -139,16 +139,6 @@
>          except CalledModuleError:
>              grass.fatal(_("Unable to create table <%s>") % table)
>
> -        # create index, see db/driver/*/index.c
> -        if driver != "dbf":
> -            sql = "CREATE UNIQUE INDEX %s_%s ON %s (%s)" % (table, key, table, key)
> -            try:
> -                grass.run_command('db.execute',
> -                                  database=database, driver=driver, sql=sql)
> -            except:
> -                grass.warning(_("Unable to create index on table <%s>") % table)
> -                pass
> -
>      # connect the map to the DB:
>      if schema:
>          table = '{schema}.{table}'.format(schema=schema, table=table)

just a conceptual question:
... are we sure that this index creation removal never leads to a
table without index?

Markus


More information about the grass-dev mailing list