[GRASS-user] v.out.postgis

Hi,

I am trying to export a vector map to PostGIS. Has anyone come across the ‘Unable to describe table’ error? I suspect my config could be wrong.

v.out.postgis --overwrite input=APGB_aerial_2_i_segment_drained_peat_with_exposed_haggs_vct@PERMANENT output=PG:dbname=webgis output_layer=APGB_aerial_2_i_segment_drained_peat_with_exposed_haggs_vct options=FID=cat, GEOMETRY_NAME=wkb_geometry, SPATIAL_INDEX=YES, PRIMARY_KEY=YES
DBMI-PostgreSQL driver error:
select * from grass_gis.APGB_aerial_2_i_segment_drained_peat
with_exposed_haggs_vct where 1 = 0
ERROR: relation "grass_gis.apgb_aerial_2_i_segment_drained

peat_with_exposed_haggs_vct" does not exist
LINE 1: select * from
grass_gis.APGB_aerial_2_i_segment_drained_peat…
^
DBMI-PostgreSQL driver error:
select * from grass_gis.APGB_aerial_2_i_segment_drained_peat
with_exposed_haggs_vct where 1 = 0
ERROR: relation "grass_gis.apgb_aerial_2_i_segment_drained

peat_with_exposed_haggs_vct" does not exist
LINE 1: select * from
grass_gis.APGB_aerial_2_i_segment_drained_peat…
^
ERROR: Unable to describe table <grass_gis.APGB_aerial_2_i_segment_drained_peat_with_exposed_haggs_vct>

Thanks,

···

Paul J. Shapley

Hi

Paul Shapley <p.shapley@gmail.com> schrieb am Do., 28. Juni 2018, 09:59:

Hi,

I am trying to export a vector map to PostGIS. Has anyone come across the ‘Unable to describe table’ error? I suspect my config could be wrong.

v.out.postgis --overwrite input=APGB_aerial_2_i_segment_drained_peat_with_exposed_haggs_vct@PERMANENT output=PG:dbname=webgis output_layer=APGB_aerial_2_i_segment_drained_peat_with_exposed_haggs_vct options=FID=cat, GEOMETRY_NAME=wkb_geometry, SPATIAL_INDEX=YES, PRIMARY_KEY=YES
DBMI-PostgreSQL driver error:
select * from grass_gis.APGB_aerial_2_i_segment_drained_peat
_with_exposed_haggs_vct where 1 = 0

… upon quick inspection:
the where 1 = 0 above looks strange to me.

But I don’t know what it could originate from.

Markus

ERROR: relation “grass_gis.apgb_aerial_2_i_segment_drained_
peat_with_exposed_haggs_vct” does not exist
LINE 1: select * from
grass_gis.APGB_aerial_2_i_segment_drained_peat…
^
DBMI-PostgreSQL driver error:
select * from grass_gis.APGB_aerial_2_i_segment_drained_peat
with_exposed_haggs_vct where 1 = 0
ERROR: relation "grass_gis.apgb_aerial_2_i_segment_drained

peat_with_exposed_haggs_vct" does not exist
LINE 1: select * from
grass_gis.APGB_aerial_2_i_segment_drained_peat…
^
ERROR: Unable to describe table <grass_gis.APGB_aerial_2_i_segment_drained_peat_with_exposed_haggs_vct>

Thanks,

Paul J. Shapley


grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

On 28/06/18 09:59, Paul Shapley wrote:

Hi,

I am trying to export a vector map to PostGIS. Has anyone come across the 'Unable to describe table' error? I suspect my config could be wrong.

v.out.postgis --overwrite input=APGB_aerial_2_i_segment_drained_peat_with_exposed_haggs_vct@PERMANENT output=PG:dbname=webgis output_layer=APGB_aerial_2_i_segment_drained_peat_with_exposed_haggs_vct options=FID=cat, GEOMETRY_NAME=wkb_geometry, SPATIAL_INDEX=YES, PRIMARY_KEY=YES
DBMI-PostgreSQL driver error:
select * from grass_gis.APGB_aerial_2_i_segment_drained_peat
_with_exposed_haggs_vct where 1 = 0
ERROR: relation "grass_gis.apgb_aerial_2_i_segment_drained_
peat_with_exposed_haggs_vct" does not exist
LINE 1: select * from
grass_gis.APGB_aerial_2_i_segment_drained_peat...
^
DBMI-PostgreSQL driver error:
select * from grass_gis.APGB_aerial_2_i_segment_drained_peat
_with_exposed_haggs_vct where 1 = 0
ERROR: relation "grass_gis.apgb_aerial_2_i_segment_drained_
peat_with_exposed_haggs_vct" does not exist
LINE 1: select * from
grass_gis.APGB_aerial_2_i_segment_drained_peat...
^
*ERROR: Unable to describe table* <grass_gis.APGB_aerial_2_i_segment_drained_peat_with_exposed_haggs_vct>

It looks like it is trying to read the input attrubute table from postgresql (schema grass_gis). Do you use PostgreSQL as attribute table backend ? Could you provide the output of db.connect -p in that mapset ?

Moritz

On Thu, Jun 28, 2018 at 1:40 PM, Moritz Lennert <mlennert@club.worldonline.be> wrote:

On 28/06/18 09:59, Paul Shapley wrote:

Hi,

I am trying to export a vector map to PostGIS. Has anyone come across the ‘Unable to describe table’ error? I suspect my config could be wrong.

v.out.postgis --overwrite input=APGB_aerial_2_i_segment_drained_peat_with_exposed_haggs_vct@PERMANENT output=PG:dbname=webgis output_layer=APGB_aerial_2_i_segment_drained_peat_with_exposed_haggs_vct options=FID=cat, GEOMETRY_NAME=wkb_geometry, SPATIAL_INDEX=YES, PRIMARY_KEY=YES
DBMI-PostgreSQL driver error:
select * from grass_gis.APGB_aerial_2_i_segment_drained_peat
with_exposed_haggs_vct where 1 = 0
ERROR: relation "grass_gis.apgb_aerial_2_i_segment_drained

peat_with_exposed_haggs_vct" does not exist
LINE 1: select * from
grass_gis.APGB_aerial_2_i_segment_drained_peat…
^
DBMI-PostgreSQL driver error:
select * from grass_gis.APGB_aerial_2_i_segment_drained_peat
with_exposed_haggs_vct where 1 = 0
ERROR: relation "grass_gis.apgb_aerial_2_i_segment_drained

peat_with_exposed_haggs_vct" does not exist
LINE 1: select * from
grass_gis.APGB_aerial_2_i_segment_drained_peat…
^
ERROR: Unable to describe table <grass_gis.APGB_aerial_2_i_segment_drained_peat_with_exposed_haggs_vct>

It looks like it is trying to read the input attrubute table from postgresql (schema grass_gis). Do you use PostgreSQL as attribute table backend ? Could you provide the output of db.connect -p in that mapset ?

ore precise would be
v.db.connect -p APGB_aerial_2_i_segment_drained_peat_with_exposed_haggs_vct@PERMANENT

because there may be a bug in v.out.postgis, not properly reading the database connection of the input vector.

Markus Metz

Moritz


grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

Hi Markus,

OK here is the result of v.db.connect -p

v.db.connect -p APGB_aerial_2_i_segment_drained_peat_with_exposed_haggs_vector
Vector map <APGB_aerial_2_i_segment_drained_peat_with_exposed_haggs_vector> is connected by:
layer <1/grass_gis.APGB_aerial_2_i_segment_drained_peat_with_exposed_haggs_vector> table <grass_gis.APGB_aerial_2_i_segment_drained_peat_with_exposed_haggs_vector> in database through driver with key

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).

Thanks,

Paul Shapley

···

On 28 June 2018 at 13:22, Markus Metz <markus.metz.giswork@gmail.com> wrote:

On Thu, Jun 28, 2018 at 1:40 PM, Moritz Lennert <mlennert@club.worldonline.be> wrote:

On 28/06/18 09:59, Paul Shapley wrote:

Hi,

I am trying to export a vector map to PostGIS. Has anyone come across the ‘Unable to describe table’ error? I suspect my config could be wrong.

v.out.postgis --overwrite input=APGB_aerial_2_i_segment_drained_peat_with_exposed_haggs_vct@PERMANENT output=PG:dbname=webgis output_layer=APGB_aerial_2_i_segment_drained_peat_with_exposed_haggs_vct options=FID=cat, GEOMETRY_NAME=wkb_geometry, SPATIAL_INDEX=YES, PRIMARY_KEY=YES
DBMI-PostgreSQL driver error:
select * from grass_gis.APGB_aerial_2_i_segment_drained_peat
with_exposed_haggs_vct where 1 = 0
ERROR: relation "grass_gis.apgb_aerial_2_i_segment_drained

peat_with_exposed_haggs_vct" does not exist
LINE 1: select * from
grass_gis.APGB_aerial_2_i_segment_drained_peat…
^
DBMI-PostgreSQL driver error:
select * from grass_gis.APGB_aerial_2_i_segment_drained_peat
with_exposed_haggs_vct where 1 = 0
ERROR: relation "grass_gis.apgb_aerial_2_i_segment_drained

peat_with_exposed_haggs_vct" does not exist
LINE 1: select * from
grass_gis.APGB_aerial_2_i_segment_drained_peat…
^
ERROR: Unable to describe table <grass_gis.APGB_aerial_2_i_segment_drained_peat_with_exposed_haggs_vct>

It looks like it is trying to read the input attrubute table from postgresql (schema grass_gis). Do you use PostgreSQL as attribute table backend ? Could you provide the output of db.connect -p in that mapset ?

ore precise would be
v.db.connect -p APGB_aerial_2_i_segment_drained_peat_with_exposed_haggs_vct@PERMANENT

because there may be a bug in v.out.postgis, not properly reading the database connection of the input vector.

Markus Metz

Moritz


grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

Paul J. Shapley MSc CGeog (GIS) FRGS

On 29/06/18 10:39, Paul Shapley wrote:

Hi Markus,

OK here is the result of v.db.connect -p

v.db.connect -p APGB_aerial_2_i_segment_drained_peat_with_exposed_haggs_vector
Vector map <APGB_aerial_2_i_segment_drained_peat_with_exposed_haggs_vector> is connected by:
layer <1/grass_gis.APGB_aerial_2_i_segment_drained_peat_with_exposed_haggs_vector> table <grass_gis.APGB_aerial_2_i_segment_drained_peat_with_exposed_haggs_vector> in database <webgis> through driver <pg> with key <cat>

So it's PostgreSQL as attribute database backend.

What is the output of

v.db.select APGB_aerial_2_i_segment_drained_peat_with_exposed_haggs_vector

?

Moritz

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).

Thanks,

Paul Shapley

On 28 June 2018 at 13:22, Markus Metz <markus.metz.giswork@gmail.com <mailto:markus.metz.giswork@gmail.com>> wrote:

    On Thu, Jun 28, 2018 at 1:40 PM, Moritz Lennert
    <mlennert@club.worldonline.be <mailto:mlennert@club.worldonline.be>>
    wrote:
     >
     > On 28/06/18 09:59, Paul Shapley wrote:
     >>
     >> Hi,
     >>
     >> I am trying to export a vector map to PostGIS. Has anyone come
    across the 'Unable to describe table' error? I suspect my config
    could be wrong.
     >>
     >> v.out.postgis --overwrite
    input=APGB_aerial_2_i_segment_drained_peat_with_exposed_haggs_vct@PERMANENT
    output=PG:dbname=webgis
    output_layer=APGB_aerial_2_i_segment_drained_peat_with_exposed_haggs_vct
    options=FID=cat, GEOMETRY_NAME=wkb_geometry, SPATIAL_INDEX=YES,
    PRIMARY_KEY=YES
     >> DBMI-PostgreSQL driver error:
     >> select * from grass_gis.APGB_aerial_2_i_segment_drained_peat
     >> _with_exposed_haggs_vct where 1 = 0
     >> ERROR: relation "grass_gis.apgb_aerial_2_i_segment_drained_
     >> peat_with_exposed_haggs_vct" does not exist
     >> LINE 1: select * from
     >> grass_gis.APGB_aerial_2_i_segment_drained_peat...
     >> ^
     >> DBMI-PostgreSQL driver error:
     >> select * from grass_gis.APGB_aerial_2_i_segment_drained_peat
     >> _with_exposed_haggs_vct where 1 = 0
     >> ERROR: relation "grass_gis.apgb_aerial_2_i_segment_drained_
     >> peat_with_exposed_haggs_vct" does not exist
     >> LINE 1: select * from
     >> grass_gis.APGB_aerial_2_i_segment_drained_peat...
     >> ^
     >> *ERROR: Unable to describe table*
    <grass_gis.APGB_aerial_2_i_segment_drained_peat_with_exposed_haggs_vct>
     >
     > It looks like it is trying to read the input attrubute table from
    postgresql (schema grass_gis). Do you use PostgreSQL as attribute
    table backend ? Could you provide the output of db.connect -p in
    that mapset ?

    ore precise would be
    v.db.connect -p
    APGB_aerial_2_i_segment_drained_peat_with_exposed_haggs_vct@PERMANENT

    because there may be a bug in v.out.postgis, not properly reading
    the database connection of the input vector.

    Markus Metz

     >
     > Moritz
     >
     > _______________________________________________
     > grass-user mailing list
     > grass-user@lists.osgeo.org <mailto:grass-user@lists.osgeo.org>
     > https://lists.osgeo.org/mailman/listinfo/grass-user
    <https://lists.osgeo.org/mailman/listinfo/grass-user&gt;

--
*Paul J. Shapley *MSc CGeog (GIS) FRGS
*

_______________________________________________
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

Hi Moritz,

Here is the result:-

v.db.select APGB_aerial_2_i_segment_drained_peat_with_exposed_haggs_vector
DBMI-PostgreSQL driver error:
Unable to select:
SELECT * FROM grass_gis.APGB_aerial_2_i_segment_drained_peat
with_exposed_haggs_vector
ERROR: relation "grass_gis.apgb_aerial_2_i_segment_drained

peat_with_exposed_haggs_vector" does not exist
LINE 1: SELECT * FROM
grass_gis.APGB_aerial_2_i_segment_drained_peat…
^
DBMI-PostgreSQL driver error:
Unable to select:
SELECT * FROM grass_gis.APGB_aerial_2_i_segment_drained_peat
with_exposed_haggs_vector
ERROR: relation "grass_gis.apgb_aerial_2_i_segment_drained

peat_with_exposed_haggs_vector" does not exist
LINE 1: SELECT * FROM
grass_gis.APGB_aerial_2_i_segment_drained_peat…
^
ERROR: Unable to open select cursor
(Fri Jun 29 11:24:18 2018) Command finished (0 sec)

···

On 29 June 2018 at 11:17, Moritz Lennert <mlennert@club.worldonline.be> wrote:

On 29/06/18 10:39, Paul Shapley wrote:

Hi Markus,

OK here is the result of v.db.connect -p

v.db.connect -p APGB_aerial_2_i_segment_drained_peat_with_exposed_haggs_vector
Vector map <APGB_aerial_2_i_segment_drained_peat_with_exposed_haggs_vector> is connected by:
layer <1/grass_gis.APGB_aerial_2_i_segment_drained_peat_with_exposed_haggs_vector> table <grass_gis.APGB_aerial_2_i_segment_drained_peat_with_exposed_haggs_vector> in database through driver with key

So it’s PostgreSQL as attribute database backend.

What is the output of

v.db.select APGB_aerial_2_i_segment_drained_peat_with_exposed_haggs_vector

?

Moritz

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).

Thanks,

Paul Shapley

On 28 June 2018 at 13:22, Markus Metz <markus.metz.giswork@gmail.com mailto:[markus.metz.giswork@gmail.com](mailto:markus.metz.giswork@gmail.com)> wrote:

On Thu, Jun 28, 2018 at 1:40 PM, Moritz Lennert
<mlennert@club.worldonline.be mailto:[mlennert@club.worldonline.be](mailto:mlennert@club.worldonline.be)>
wrote:

On 28/06/18 09:59, Paul Shapley wrote:

Hi,

I am trying to export a vector map to PostGIS. Has anyone come
across the ‘Unable to describe table’ error? I suspect my config
could be wrong.

v.out.postgis --overwrite
input=APGB_aerial_2_i_segment_drained_peat_with_exposed_haggs_vct@PERMANENT
output=PG:dbname=webgis
output_layer=APGB_aerial_2_i_segment_drained_peat_with_exposed_haggs_vct
options=FID=cat, GEOMETRY_NAME=wkb_geometry, SPATIAL_INDEX=YES,
PRIMARY_KEY=YES
DBMI-PostgreSQL driver error:
select * from grass_gis.APGB_aerial_2_i_segment_drained_peat
with_exposed_haggs_vct where 1 = 0
ERROR: relation "grass_gis.apgb_aerial_2_i_segment_drained

peat_with_exposed_haggs_vct" does not exist
LINE 1: select * from
grass_gis.APGB_aerial_2_i_segment_drained_peat…
^
DBMI-PostgreSQL driver error:
select * from grass_gis.APGB_aerial_2_i_segment_drained_peat
with_exposed_haggs_vct where 1 = 0
ERROR: relation "grass_gis.apgb_aerial_2_i_segment_drained

peat_with_exposed_haggs_vct" does not exist
LINE 1: select * from
grass_gis.APGB_aerial_2_i_segment_drained_peat…
^
ERROR: Unable to describe table
<grass_gis.APGB_aerial_2_i_segment_drained_peat_with_exposed_haggs_vct>

It looks like it is trying to read the input attrubute table from
postgresql (schema grass_gis). Do you use PostgreSQL as attribute
table backend ? Could you provide the output of db.connect -p in
that mapset ?

ore precise would be
v.db.connect -p
APGB_aerial_2_i_segment_drained_peat_with_exposed_haggs_vct@PERMANENT

because there may be a bug in v.out.postgis, not properly reading
the database connection of the input vector.

Markus Metz

Moritz


grass-user mailing list
grass-user@lists.osgeo.org mailto:[grass-user@lists.osgeo.org](mailto:grass-user@lists.osgeo.org)
https://lists.osgeo.org/mailman/listinfo/grass-user
<https://lists.osgeo.org/mailman/listinfo/grass-user>


*Paul J. Shapley *MSc CGeog (GIS) FRGS
*
*


grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

Paul J. Shapley MSc CGeog (GIS) FRGS

On 29/06/18 12:38, Paul Shapley wrote:

Hi Moritz,

Here is the result:-

v.db.select APGB_aerial_2_i_segment_drained_peat_with_exposed_haggs_vector
DBMI-PostgreSQL driver error:
Unable to select:
SELECT * FROM grass_gis.APGB_aerial_2_i_segment_drained_peat
_with_exposed_haggs_vector
ERROR: relation "grass_gis.apgb_aerial_2_i_segment_drained_
peat_with_exposed_haggs_vector" does not exist
LINE 1: SELECT * FROM
grass_gis.APGB_aerial_2_i_segment_drained_peat...
^
DBMI-PostgreSQL driver error:
Unable to select:
SELECT * FROM grass_gis.APGB_aerial_2_i_segment_drained_peat
_with_exposed_haggs_vector
ERROR: relation "grass_gis.apgb_aerial_2_i_segment_drained_
peat_with_exposed_haggs_vector" does not exist
LINE 1: SELECT * FROM
grass_gis.APGB_aerial_2_i_segment_drained_peat...
^
ERROR: Unable to open select cursor
(Fri Jun 29 11:24:18 2018) Command finished (0 sec)

So, apparently your vector map is linked to a table that does not exist. Or it exists but not in the schema grass_gis. You will have to correct the link between the map and its attribute table before you can export it.

Moritz

Hi Moritz,

My apologies… it appears that the result of 'r.to.vect was indeed sending the attributes to postgres but i was expecting them to appear in sqlite had i ‘refreshed’ the posgres schema i would have seen them.

Best Wishes and thank you,

Paul Shapley

···

On 29 June 2018 at 14:50, Moritz Lennert <mlennert@club.worldonline.be> wrote:

On 29/06/18 12:38, Paul Shapley wrote:

Hi Moritz,

Here is the result:-

v.db.select APGB_aerial_2_i_segment_drained_peat_with_exposed_haggs_vector
DBMI-PostgreSQL driver error:
Unable to select:
SELECT * FROM grass_gis.APGB_aerial_2_i_segment_drained_peat
with_exposed_haggs_vector
ERROR: relation "grass_gis.apgb_aerial_2_i_segment_drained

peat_with_exposed_haggs_vector" does not exist
LINE 1: SELECT * FROM
grass_gis.APGB_aerial_2_i_segment_drained_peat…
^
DBMI-PostgreSQL driver error:
Unable to select:
SELECT * FROM grass_gis.APGB_aerial_2_i_segment_drained_peat
with_exposed_haggs_vector
ERROR: relation "grass_gis.apgb_aerial_2_i_segment_drained

peat_with_exposed_haggs_vector" does not exist
LINE 1: SELECT * FROM
grass_gis.APGB_aerial_2_i_segment_drained_peat…
^
ERROR: Unable to open select cursor
(Fri Jun 29 11:24:18 2018) Command finished (0 sec)

So, apparently your vector map is linked to a table that does not exist. Or it exists but not in the schema grass_gis. You will have to correct the link between the map and its attribute table before you can export it.

Moritz

Paul J. Shapley MSc CGeog (GIS) FRGS