<div dir="ltr">Hi Moritz,<div><br></div><div>Here is the result:-</div><div><br></div><div><div>v.db.select APGB_aerial_2_i_segment_drained_peat_with_exposed_haggs_vector      </div><div>DBMI-PostgreSQL driver error:</div><div>Unable to select:</div><div>SELECT * FROM grass_gis.APGB_aerial_2_i_segment_drained_peat</div><div>_with_exposed_haggs_vector</div><div>ERROR:  relation "grass_gis.apgb_aerial_2_i_segment_drained_</div><div>peat_with_exposed_haggs_vector" does not exist</div><div>LINE 1: SELECT * FROM</div><div>grass_gis.APGB_aerial_2_i_segment_drained_peat...</div><div>                      ^</div><div>DBMI-PostgreSQL driver error:</div><div>Unable to select:</div><div>SELECT * FROM grass_gis.APGB_aerial_2_i_segment_drained_peat</div><div>_with_exposed_haggs_vector</div><div>ERROR:  relation "grass_gis.apgb_aerial_2_i_segment_drained_</div><div>peat_with_exposed_haggs_vector" does not exist</div><div>LINE 1: SELECT * FROM</div><div>grass_gis.APGB_aerial_2_i_segment_drained_peat...</div><div>                      ^</div><div>ERROR: Unable to open select cursor</div><div>(Fri Jun 29 11:24:18 2018) Command finished (0 sec)</div></div><div><br></div><div>---------------------------------------------------------------------------------------------</div><div><br></div><div>I have two databases that i use in grass, the (sqlite.db) for vector data (e.g using r.to.vect) then i usually export the results to postgresql/postgis (webgis). The 'db.login' file holds the PostGIS details above the sqlite details. If i try to open the attributes (of sqlite) from within Grass it is trying to find them in postgres/postgis (webgis). see cmdline error:-</div><div><br></div><div>GRASS_INFO_WARNING<1408,1>:Table <grass_gis.APGB_aerial_2_i_segment_drained_peat_with_exposed_haggs_vector> not found in database <webgis> using driver <pg> GRASS_INFO_END<1408,1></div><div><br></div><div>Is the order of the connection details in 'pg.login' important?</div><div><br></div><div>Paul Shapley</div></div><div class="gmail_extra"><br><div class="gmail_quote">On 29 June 2018 at 11:17, Moritz Lennert <span dir="ltr"><<a href="mailto:mlennert@club.worldonline.be" target="_blank">mlennert@club.worldonline.be</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On 29/06/18 10:39, Paul Shapley wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi Markus,<br>
<br>
OK here is the result of v.db.connect -p<br>
<br>
v.db.connect -p APGB_aerial_2_i_segment_draine<wbr>d_peat_with_exposed_haggs_<wbr>vector<br>
Vector map <APGB_aerial_2_i_segment_drain<wbr>ed_peat_with_exposed_haggs_<wbr>vector> is connected by:<br>
layer <1/grass_gis.APGB_aerial_2_i_s<wbr>egment_drained_peat_with_expos<wbr>ed_haggs_vector> table <grass_gis.APGB_aerial_2_i_seg<wbr>ment_drained_peat_with_exposed<wbr>_haggs_vector> in database <webgis> through driver <pg> with key <cat><br>
</blockquote>
<br>
So it's PostgreSQL as attribute database backend.<br>
<br>
What is the output of<br>
<br>
v.db.select APGB_aerial_2_i_segment_draine<wbr>d_peat_with_exposed_haggs_<wbr>vector<br>
<br>
?<br>
<br>
Moritz<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
I recall some years ago you had to delete the 'db.login' file and recreate it but this would lose the connection to the vector layer attribute table (sqlite.db).<br>
<br>
Thanks,<br>
<br>
Paul Shapley<br>
<br>
On 28 June 2018 at 13:22, Markus Metz <<a href="mailto:markus.metz.giswork@gmail.com" target="_blank">markus.metz.giswork@gmail.com</a> <mailto:<a href="mailto:markus.metz.giswork@gmail.com" target="_blank">markus.metz.giswork@gm<wbr>ail.com</a>>> wrote:<br>
<br>
<br>
<br>
    On Thu, Jun 28, 2018 at 1:40 PM, Moritz Lennert<br>
    <<a href="mailto:mlennert@club.worldonline.be" target="_blank">mlennert@club.worldonline.be</a> <mailto:<a href="mailto:mlennert@club.worldonline.be" target="_blank">mlennert@club.worldonl<wbr>ine.be</a>>><br>
    wrote:<br>
     ><br>
     > On 28/06/18 09:59, Paul Shapley wrote:<br>
     >><br>
     >> Hi,<br>
     >><br>
     >> I am trying to export a vector map to PostGIS. Has anyone come<br>
    across the 'Unable to describe table' error? I suspect my config<br>
    could be wrong.<br>
     >><br>
     >> v.out.postgis --overwrite<br>
    input=APGB_aerial_2_i_segment_<wbr>drained_peat_with_exposed_hagg<wbr>s_vct@PERMANENT<br>
    output=PG:dbname=webgis<br>
    output_layer=APGB_aerial_2_i_s<wbr>egment_drained_peat_with_expos<wbr>ed_haggs_vct<br>
    options=FID=cat, GEOMETRY_NAME=wkb_geometry, SPATIAL_INDEX=YES,<br>
    PRIMARY_KEY=YES<br>
     >> DBMI-PostgreSQL driver error:<br>
     >> select * from grass_gis.APGB_aerial_2_i_segm<wbr>ent_drained_peat<br>
     >> _with_exposed_haggs_vct where 1 = 0<br>
     >> ERROR:  relation "grass_gis.apgb_aerial_2_i_seg<wbr>ment_drained_<br>
     >> peat_with_exposed_haggs_vct" does not exist<br>
     >> LINE 1: select * from<br>
     >> grass_gis.APGB_aerial_2_i_segm<wbr>ent_drained_peat...<br>
     >>                        ^<br>
     >> DBMI-PostgreSQL driver error:<br>
     >> select * from grass_gis.APGB_aerial_2_i_segm<wbr>ent_drained_peat<br>
     >> _with_exposed_haggs_vct where 1 = 0<br>
     >> ERROR:  relation "grass_gis.apgb_aerial_2_i_seg<wbr>ment_drained_<br>
     >> peat_with_exposed_haggs_vct" does not exist<br>
     >> LINE 1: select * from<br>
     >> grass_gis.APGB_aerial_2_i_segm<wbr>ent_drained_peat...<br>
     >>                        ^<br>
     >> *ERROR: Unable to describe table*<br>
    <grass_gis.APGB_aerial_2_i_seg<wbr>ment_drained_peat_with_exposed<wbr>_haggs_vct><br>
     ><br>
     ><br>
     > It looks like it is trying to read the input attrubute table from<br>
    postgresql (schema grass_gis). Do you use PostgreSQL as attribute<br>
    table backend ? Could you provide the output of db.connect -p in<br>
    that mapset ?<br>
<br>
    ore precise would be<br>
    v.db.connect -p<br>
    APGB_aerial_2_i_segment_draine<wbr>d_peat_with_exposed_haggs_vct@<wbr>PERMANENT<br>
<br>
    because there may be a bug in v.out.postgis, not properly reading<br>
    the database connection of the input vector.<br>
<br>
    Markus Metz<br>
<br>
     ><br>
     > Moritz<br>
     ><br>
     > ______________________________<wbr>_________________<br>
     > grass-user mailing list<br>
     > <a href="mailto:grass-user@lists.osgeo.org" target="_blank">grass-user@lists.osgeo.org</a> <mailto:<a href="mailto:grass-user@lists.osgeo.org" target="_blank">grass-user@lists.osgeo<wbr>.org</a>><br>
     > <a href="https://lists.osgeo.org/mailman/listinfo/grass-user" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailma<wbr>n/listinfo/grass-user</a><br>
    <<a href="https://lists.osgeo.org/mailman/listinfo/grass-user" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailm<wbr>an/listinfo/grass-user</a>><br>
<br>
<br>
<br><span class="HOEnZb"><font color="#888888">
<br>
-- <br>
*Paul J. Shapley *MSc CGeog (GIS) FRGS<br>
*<br>
*<br>
<br>
<br>
______________________________<wbr>_________________<br>
grass-user mailing list<br>
<a href="mailto:grass-user@lists.osgeo.org" target="_blank">grass-user@lists.osgeo.org</a><br>
<a href="https://lists.osgeo.org/mailman/listinfo/grass-user" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailma<wbr>n/listinfo/grass-user</a><br>
<br>
</font></span></blockquote>
<br>
<br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><b>Paul J. Shapley </b><span style="font-family:times new roman,serif"><font size="2"><span style="font-family:arial,helvetica,sans-serif">MSc CGeog (GIS) FRGS</span></font><br></span><b><br></b></div></div>
</div>