<div dir="ltr"><div><div><br><br>On Thu, Apr 5, 2018 at 3:30 PM, Camille Bezzina <<a href="mailto:camille.bezzina@geophom.fr">camille.bezzina@geophom.fr</a>> wrote:<br>><br>> Ok thanks Markus for your answer.<br>><br>> But I have another question :<br>><br>> I have 2  differents vectors with the same attribute table structure.<br>><br>> This problem is just for one of them.<br>><br>> For the first vector the attribute table is like that :<br>><br>> > name                   type                              length<br>> ><br>> > cat                      integer                           20<br>> > ID                       character                       24  <br>> > PREC_PLANI       double precision             20<br>> > NATURE              character                       31<br>> > HAUTEUR           integer                            20<br>> > id_2                    integer                            20<br>><br>> and for the second :<br>><br>> > name                   type                              length<br>> ><br>> > cat                      integer                           20<br>> > ID                       text                       1000  <br>> > PREC_PLANI       double precision             20<br>> > NATURE             text                      1000<br>> > HAUTEUR           integer                            20<br>> > id_2                    integer                            20<br>><br>> So when I want to patch my 2 vectors with v.patch, there is the following message :<br>><br>> (Thu Apr  5 15:01:50 2018)                                                     <br>> v.patch -e --overwrite --verbose input=zone_vegetation_D90_decoupe@AIP_RONCHAMP_MNE,zone_vegetation_D70_decoupe@AIP_RONCHAMP_MNE output=TEST_merge_D70_D90<br>> ERROR: Length of string columns differ<br>> (Thu Apr  5 15:01:51 2018) La commande s'est terminée (1 sec) <br><br></div>I see. v.db.dropcolumn was removing the field length for SQLite tables, fixed in trunk r72591.<br><br></div>Markus M<br><div><div>><br>><br>><br>><br>> Le 05/04/2018 à 14:41, Markus Metz a écrit :<br>><br>><br>><br>> On Wed, Apr 4, 2018 at 5:54 PM, Camille Bezzina <<a href="mailto:camille.bezzina@geophom.fr">camille.bezzina@geophom.fr</a>> wrote:<br>> ><br>> > Hello all,<br>> ><br>> ><br>> > I have a problem when I want to modify an attribute table.<br>> ><br>> > I add a new vector with v.in.ogr. My attribute table is build like that :<br>> ><br>> > name                   type                              length<br>> ><br>> > cat                      integer                           20<br>> > ID                       character                       24  <br>> > PREC_PLANI       double precision             20<br>> > NATURE              character                       31<br>> > HAUTEUR           integer                            20<br>> > id_2                    integer                            20<br>> ><br>> ><br>> > I would like to remove the column 'HAUTEUR', but when I remove this<br>> > column, my two character columns (ID and NATURE) change automatically to<br>> > become :<br>> ><br>> > ID                   text        1000<br>> > NATURE         text        1000<br>> ><br>> > Do you know why the simple fact to remove a column (HAUTEUR) change type<br>> > and length of other columns.<br>><br>> The reason is that GRASS uses SQLite as database manager, and in SQLite there is nothing like varchar(24), only text without any length restrictions. That means, when importing vector data with attributes, any text fields are converted to text by SQLite itself. The value 1000 as length for text is somewhat misleading here because the maximum allowed length in SQLite is by default 1 billion.<br>><br>> Markus M<br>> ><br>> > Thanks,<br>> > --<br>> ><br>> > Camille BEZZINA<br>> > Chargé d'études géomatiques et photomontages<br>> > Geophom<br>> > 57 rue du Chemin Neuf 44521 OUDON<br>> > Standard: +33(0)2 85 52 02 59<br>> > Ligne directe: +33(0)9 72 56 81 71<br>> > <a href="http://www.geophom.fr">www.geophom.fr</a><br>> ><br>> > _______________________________________________<br>> > grass-user mailing list<br>> > <a href="mailto:grass-user@lists.osgeo.org">grass-user@lists.osgeo.org</a><br>> > <a href="https://lists.osgeo.org/mailman/listinfo/grass-user">https://lists.osgeo.org/mailman/listinfo/grass-user</a><br>><br>><br>> --<br>> Camille BEZZINA<br>> Chargé d'études géomatiques et photomontages<br>> Geophom<br>> 57 rue du Chemin Neuf 44521 OUDON<br>> Standard: +33(0)2 85 52 02 59<br>> Ligne directe: +33(0)9 72 56 81 71<br>> <a href="http://www.geophom.fr">www.geophom.fr</a><br><br></div></div></div>