[GRASS-user] GRASS 6.41, Ubuntu 10.10, spearfish, v.db.join error DBMI-Postgres driver error: [. . .] ERROR: value too long for type character(1)

Katie U bracket at comcast.net
Fri Jun 10 10:25:13 EDT 2011


Friends,


This is a newbie question about working with the PostgresSql database 
driver  and grass vector mapsets.

I am learning GRASS and Postgres, and not working on any particular 
project, although my next goal is to be able to use US Census data.

For now, I'm using spearfish data, with the example in the v.db.join 
manual page. I did migrate the mysoils mapset to a mapset that is 
connected to a PostGres DBMI.  The instructions are mostly useful up to 
the join, where an error occurs.

The error text is at the end of this message.

The help that I seek is first, a reference to other tutorials that 
discuss joins and or layers, or for the patient, a quick look through my 
notes here and a reply with some good hints
to build a mapset to visualize categories of vector data.


Many thanks,

Katie Urey
Portland, Oregon US



------------------------------

some details about the error:
--------------------------

My System: Ubuntu 10:10


My Grass Version and Environment:
GRASS 6.4.1 (2011)
GISDBASE=/home/GrassWork
LOCATION_NAME=spearfish60
MAPSET=spearfish_pg
GRASS_DB_ENCODING=utf-8
MONITOR=cairo7
GRASS_GUI=wxpython


My database environment to setup a join:  postgres:
VERSION = 'PostgreSQL 8.4.8 on i686-pc-linux-gnu, compiled by GCC 
gcc-4.4.real (Ubuntu/Linaro 4.4.4-14ubuntu5) 4.4.5, 32-bit'
DBNAME = 'spearfish'
USER = 'katie'
PORT = '5432'
ENCODING = 'UTF8'

I start grass, and at the command line, connect to the database, confirm
==========

:~ > db.tables -p driver=pg | grep -v info
   public.soils_legend


:~ >v.db.connect -p map=mysoils_pg
   Vector map <mysoils_pg at spearfish_pg> is connected by:
   layer <1> table <public.mysoils_pg> in database <spearfish> through 
driver <pg> with key <cat>

:~ > v.db.join --v map=mysoils_pg column=label 
otable=public.soils_legend ocolumn=shortname

DBMI-Postgres driver error:
Cannot execute:
UPDATE public.mysoils_pg SET id=(SELECT id
FROM public.soils_legend WHERE 
public.soils_legend.shortname=public.mysoils_pg.label)
ERROR:  value too long for type character(1)


ERROR: Error while executing: 'UPDATE public.mysoils_pg SET id=(SELECT id
        FROM public.soils_legend WHERE
        public.soils_legend.shortname=public.mysoils_pg.label)'
DBMI-Postgres driver error:
Cannot execute:
UPDATE public.mysoils_pg SET shortname=(SELECT shortname
FROM public.soils_legend WHERE 
public.soils_legend.shortname=public.mysoils_pg.label)
ERROR:  value too long for type character(1)


ERROR: Error while executing: 'UPDATE public.mysoils_pg SET
        shortname=(SELECT shortname
        FROM public.soils_legend WHERE
        public.soils_legend.shortname=public.mysoils_pg.label)'
DBMI-Postgres driver error:
Cannot execute:
UPDATE public.mysoils_pg SET longname=(SELECT longname
FROM public.soils_legend WHERE 
public.soils_legend.shortname=public.mysoils_pg.label)
ERROR:  value too long for type character(1)


ERROR: Error while executing: 'UPDATE public.mysoils_pg SET
        longname=(SELECT longname
        FROM public.soils_legend WHERE
        public.soils_legend.shortname=public.mysoils_pg.label)'


---- end of error---


No data is transferred, columns are setup with width=1.

~ > db.select mysoils_pg | head -3
cat|label|id|shortname|longname
1|Aab|||
2|Ba|||


More information about the grass-user mailing list