If I change this view:
SELECT dallas_rlc_locations.location_code, count(dallas_rlc."CitationId") AS count, dallas_rlc_locations.location, dallas_rlc_locations.the_geom
FROM raw.dallas_rlc_locations
LEFT JOIN raw.dallas_rlc ON dallas_rlc."Loc Code" = dallas_rlc_locations.location_code
WHERE dallas_rlc."CitationId" IS NOT NULL
GROUP BY dallas_rlc_locations.location, dallas_rlc_locations.location_code, dallas_rlc_locations.the_geom;
...to this:
SELECT count(dallas_rlc."CitationId") AS count, dallas_rlc_locations.location_code, dallas_rlc_locations.location, dallas_rlc_locations.the_geom
FROM raw.dallas_rlc_locations
LEFT JOIN raw.dallas_rlc ON dallas_rlc."Loc Code" = dallas_rlc_locations.location_code
WHERE dallas_rlc."CitationId" IS NOT NULL
GROUP BY dallas_rlc_locations.location, dallas_rlc_locations.location_code, dallas_rlc_locations.the_geom;
(I just reversed the first two fields in the SELECT)
I get this error:
Huh? A few is impermanent. There's no reason why I can't arbitrarily change the view's underlying code as I wish, as long as the final result is valid SQL. Even if PostgreSQL has some kind of limitation (not alleging it does, just speculating), couldn't pgAdmin help us out here and get us around the limitation?
I am using Postgres 9.1.1 and its bundled pgAdmin III 1.14.0 on Windows 7 x64.
Aren