[GRASSLIST:284] d.vect.pg
David Orme
d.orme at imperial.ac.uk
Wed Jun 4 05:02:00 EDT 2003
Hi,
Can someone help with the following behaviour in GRASS 5.0.0?
I've imported a shapefile (via v.in.shape) and passed the associated
dbf to PostGreSQL (via pg.in.dbf). All seems well with both the table
and the vector file by comparison to the original in ArcGIS.
If I use the tcltkgrass interface to perform a d.vect.pg select it
works, yet if I enter the same command at the command line it fails.
The outputs are below - the difference seems to be that the command
line version is stripping the quotes from the where clause.
> Executing
> SELECT Distinct _ID from globalebas_region where _name='Jamaica' and
> _ID is not null;
>
> 1 Rows
> GRASS 5.0.0 > d.vect.pg key=_ID tab=globalebas_region
> where=_name='Jamaica' map=eba color=red
> Executing
> SELECT Distinct _ID from globalebas_region where _name=Jamaica and
> _ID is not null;
>
> Error Connecting to Postgres:ERROR: Attribute "jamaica" not found
>
> Mapset <dorme> in Location <global>
> GRASS 5.0.0 >
>
As a follow up, neither command line nor GUI seems to be able to handle
spaces in text strings in the where clause. If I replace 'Jamiaca' with
'Peru-Chile Pacific slope' in the GUI then I get the following:
> Sorry <Pacific> is not a valid option
> Sorry <Slope"> is not a valid option
At the command line, I get the following:
> GRASS 5.0.0 > d.vect.pg key=_ID tab=globalebas_region
> where=_name='Peru-Chile Pacific slope' map=eba color=red
> Executing
> SELECT Distinct _ID from globalebas_region where _name=Peru-Chile
> Pacific slope and _ID is not null;
>
> Error Connecting to Postgres:ERROR: parser: parse error at or near
> "Pacific" at character 69
Thanks in advance,
David
More information about the grass-user
mailing list