[GRASS-user] Change SQLite DB Column Width?

Jeshua Lacock jeshua at 3DTOPO.com
Sun Aug 6 14:56:05 PDT 2017


> On Aug 5, 2017, at 10:11 AM, Even Rouault <even.rouault at spatialys.com> wrote:
> 
> The condition is name = 'TrailSegment_12' not type =

Doh! Thanks - I had copied in your SQL but when it didn’t work I resorted to finding more examples on the web.

The reason why your suggested SQL wasn’t working was because I wasn’t setting the database connection with <grin>:

.open /Volumes/bigy/National/transportation/PERMANENT/sqlite/sqlite.db

I was able to reconfigure the schema as you suggested, and when I re-ran the SELECT SQL command, it showed the new size:

sqlite> SELECT SQL FROM SQLITE_MASTER WHERE NAME = 'TrailSegment_Wyoming’;



But v.patch -e still wouldn’t work. I looked at the table in the GUI and it still showed the old width of the column:



So as far as I can tell this solution won’t work, which is a bummer. I ended up getting around the issue by copying a target table, dropping all rows then inserting rows from the mismatched table (essentially as Vincent suggested).

I think it would be REALLY nice if we could supply a schema when importing with v.in.ogr. Apparently it allows you to specify the columns (but not specify their data type and width?). For instance I wish something like this worked:

v.in.ogr columns="GNIS_ID varchar(80), NAME varchar(128), etc."

That way, if as long as I used the same schema for different imports, they would all be combinable without any issue.


Best,

Jeshua Lacock
Founder/Engineer
<3DTOPO.com>
GlassPrinted.com

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/grass-user/attachments/20170806/3ff05642/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Screen Shot 2017-08-06 at 3.43.57 PM.png
Type: image/png
Size: 69349 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/grass-user/attachments/20170806/3ff05642/attachment-0002.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Screen Shot 2017-08-05 at 5.42.44 PM.png
Type: image/png
Size: 132873 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/grass-user/attachments/20170806/3ff05642/attachment-0003.png>


More information about the grass-user mailing list