[GRASS-user] db.select limitation + psql workaround
"Peter Löwe"
peter.loewe at gmx.de
Fri Jan 16 10:37:30 EST 2009
-
> > 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
I do agree. However, since the statement begins with the "SELECT"-string, db.execute refuses to execute it.
Peter
--
Dr. Peter Löwe
<peter.loewe at gmx.de>
Psssst! Schon vom neuen GMX MultiMessenger gehört? Der kann`s mit allen: http://www.gmx.net/de/go/multimessenger
More information about the grass-user
mailing list