[GRASS-user] db.select limitation + psql workaround
Moritz Lennert
mlennert at club.worldonline.be
Fri Jan 16 10:15:49 EST 2009
On 16/01/09 16:06, peter.loewe at gmx.de wrote:
> Hi,
>
> db.select balks when the SELECT queries are sufficiently complex (experienced in GRASS6.3).
>
> Example:
>
> echo
> "SELECT county_id,county_name_ascii, max(area) INTO ovl_max FROM (SELECT county_id::integer,county_name_ascii,met_id,area FROM ovl_110 GROUP BY county_id,county_name_ascii,area,met_id ORDER BY county_name_ascii) FOO GROUP BY FOO.county_name_ascii,FOO.county_id;"
> | db.select
>
> results in:
> DBMI-Postgres driver error:
> Cannot select:
> SELECT county_id,county_name_ascii, max(area) INTO ovl_max FROM (SELECT county_id::integer,county_name_ascii,met_id,area FROM ovl_110 GROUP BY county_id,county_name_ascii,area,met_id ORDER BY county_name_ascii) FOO GROUP BY FOO.county_name_ascii,FOO.county_id;
Could this be because of the SELECT ... INTO which in my logic is a
special case of the SELECT statement which would need to be executed via
db.execute as db.select only handles "pure" selections, i.e. no
modifications or creations ?
Moritz
More information about the grass-user
mailing list