[postgis-users] Please help - Value too long

David Blasby dblasby at refractions.net
Mon May 12 12:02:45 PDT 2003


Oscar Testa wrote:

> SELECT 
> nivel_imp::text,asbinary(force_collection(force_2d(the_geom)),'NDR'),OID::text 
> from (select localidad_plano.oid as oid, localidad_plano.the_geom as 
> the_geom, web_implem_grado.grado as nivel_imp from localidad_plano, 
> inf_institucion, web_implem, web_implem_grado WHERE 
> localidad_plano.codigopostal = 
> bpchar(inf_institucion.codigo_postal,10) AND 
> inf_institucion.id_institucion = web_implem.id_institucion AND 
> web_implem.pampa = web_implem_grado.grado ) AS foo WHERE the_geom && 
> setSRID('BOX3D(-73.597264 -57.9529488695652,-53.562864 
> -18.8021391304348)'::BOX3D, 4326 )
>  
> but i have the next error when i try to run this sql in pgadmin
>  
> "value too long for type character(6).

You are most likely joining a column that is char(6) with a column that 
is larger, say char(10).
This is mostly likely in the "localidad_plano.codigopostal = 
bpchar(inf_institucion.codigo_postal,10)" clause.

Does that help?  If not, look at the definition of 
"localidad_plano.codigopostal" - its probably char(6). 
 "bpchar(inf_institucion.codigo_postal,10)" is probably making a char(10).  
Something like "text(localidad_plano.codigopostal) = 
text(bpchar(inf_institucion.codigo_postal,10))" might work.

dave




More information about the postgis-users mailing list