[QGIS-trac] Re: [Quantum GIS] #1718: Incorrect unique key
interpretation on PostGIS view - view doesn't load as expected
Quantum GIS
qgis at qgis.org
Sat May 30 14:00:51 EDT 2009
#1718: Incorrect unique key interpretation on PostGIS view - view doesn't load as
expected
-----------------------------------------------------+----------------------
Reporter: mwtoews | Owner: nobody
Type: bug | Status: new
Priority: major: does not work as expected | Milestone: Version 1.0.3
Component: Data Provider | Version: HEAD
Resolution: | Keywords:
Platform_version: | Platform: Windows
Must_fix: No | Status_info: 0
-----------------------------------------------------+----------------------
Comment (by mwtoews):
Replying to [comment:2 jef]:
> QGIS fails to interpret the alternative names {{{spt}}}, {{{smp}}} and
{{{ana}}}. If you use the original names in the view the view is addable.
Thanks jef, that's useful info. This means a simple workaround is to avoid
table aliases in the PG view, e.g.:
{{{
CREATE OR REPLACE VIEW spot_analysis AS
SELECT analysis.sid AS analysis_sid, spot.geometry, spot.id AS spot_id,
sample.sid AS sample_sid, analysis.parameter, analysis.result
FROM spot
JOIN sample ON spot.id::text = sample.spot_id::text
JOIN analysis ON sample.sid = analysis.sample_sid;
}}}
works fine in both 1.0.2 and 1.2.0
--
Ticket URL: <http://trac.osgeo.org/qgis/ticket/1718#comment:3>
Quantum GIS <http://qgis.org>
Quantum GIS is an Open Source GIS viewer/editor supporting OGR, PostGIS, and GRASS formats
More information about the QGIS-trac
mailing list