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

2019-01-30 Thread Huidae Cho
r74043 works. Thanks, Huidae On Wed, Jan 30, 2019 at 4:20 AM Markus Metz wrote: > > > On Wed, Jan 30, 2019 at 9:42 AM Markus Metz > wrote: > > > > > > > > On Tue, Jan 29, 2019 at 11:37 PM Huidae Cho wrote: > > > > > > Just for our records, actually, PostgreSQL 9.5+ supports CREATE INDEX > IF

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

2019-01-30 Thread Markus Metz
On Wed, Jan 30, 2019 at 9:42 AM Markus Metz wrote: > > > > On Tue, Jan 29, 2019 at 11:37 PM Huidae Cho wrote: > > > > Just for our records, actually, PostgreSQL 9.5+ supports CREATE INDEX IF NOT EXISTS, which the grass sqlite driver already does (this is why we didn't have this warning with

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

2019-01-30 Thread Markus Metz
On Tue, Jan 29, 2019 at 11:37 PM Huidae Cho wrote: > > Just for our records, actually, PostgreSQL 9.5+ supports CREATE INDEX IF NOT EXISTS, which the grass sqlite driver already does (this is why we didn't have this warning with sqlite before). Not sure if we want to enforce the minimum version

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

2019-01-30 Thread Markus Metz
On Tue, Jan 29, 2019 at 11:17 PM Huidae Cho wrote: > > I just did a quick search and found that these modules (i.segment.stats, r.mwprecip, v.in.geopaparazzi, v.link.precip, v.out.gps, v.ply.rectify, v.unpack) create/copy new tables themselves without the index and invoke v.db.connect. For now,

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

2019-01-29 Thread Huidae Cho
Just for our records, actually, PostgreSQL 9.5+ supports CREATE INDEX IF NOT EXISTS, which the grass sqlite driver already does (this is why we didn't have this warning with sqlite before). Not sure if we want to enforce the minimum version for a specific database though. Best, Huidae On Tue,

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

2019-01-29 Thread Huidae Cho
I just did a quick search and found that these modules (i.segment.stats, r.mwprecip, v.in.geopaparazzi, v.link.precip, v.out.gps, v.ply.rectify, v.unpack) create/copy new tables themselves without the index and invoke v.db.connect. For now, we cannot move index creation to v.db.addtable. Huidae

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

2019-01-29 Thread Huidae Cho
Yes. Like you said, v.db.connect followed by v.db.connect -d gives me the same pg errors and grass warning. I agree with you that the preferred solution would be to create the index in v.db.addtable, not in v.db.connect "if" no modules rely on v.db.connect for creating the unique index. Huidae

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

2019-01-29 Thread Markus Metz
On Tue, Jan 29, 2019 at 4:12 PM Huidae Cho wrote: > > You're right. It was a warning with PostgresSQL error messages (attached below), not a fatal error. But I don't think there should be any warning (or PostgreSQL errors) because the user didn't do anything wrong here (v.edit map tool=create;

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

2019-01-29 Thread Huidae Cho
You're right. It was a warning with PostgresSQL error messages (attached below), not a fatal error. But I don't think there should be any warning (or PostgreSQL errors) because the user didn't do anything wrong here (v.edit map tool=create; v.db.addtable). DBMI-PostgreSQL driver error: Unable to

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

2019-01-29 Thread Markus Metz
On Sun, Jan 27, 2019 at 11:21 AM Markus Metz wrote: > > > > On Sat, Jan 26, 2019 at 2:50 PM Huidae Cho wrote: > > > > Markus, > > > > If there is a linked table, v.db.addtable stops in line 106. If not, this script doesn't create a unique index and calls v.db.connect. v.db.connect adds a db link

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

2019-01-27 Thread Markus Metz
On Sat, Jan 26, 2019 at 2:50 PM Huidae Cho wrote: > > Markus, > > If there is a linked table, v.db.addtable stops in line 106. If not, this script doesn't create a unique index and calls v.db.connect. v.db.connect adds a db link in line 317 and creates a unique index (db_create_index2) in line

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

2019-01-26 Thread Huidae Cho
Or maybe, to be more flexible... 1. v.db.addtable doesn't create unique index 2. v.db.connect creates unique index "only if" there is no unique index Just my 2 cents On Sat, Jan 26, 2019 at 8:50 AM Huidae Cho wrote: > Markus, > > If there is a linked table, v.db.addtable stops in line 106. If

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

2019-01-26 Thread Huidae Cho
Markus, If there is a linked table, v.db.addtable stops in line 106. If not, this script doesn't create a unique index and calls v.db.connect. v.db.connect adds a db link in line 317 and creates a unique index (db_create_index2) in line 334 if linking was successful. SQLite didn't complain when

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

2019-01-26 Thread Markus Neteler
Hi, On Tue, Jan 22, 2019 at 3:51 AM 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 >