[mapserver-users] Using unique

Steve Lime sdlime at gmail.com
Fri Jul 15 07:30:04 PDT 2011


I've always used unique with PostGIS so it's not a surprise. The one-pass query stuff added in 5.6 probably the culprit. You might file a ticket just in case and the PostGIS devs can comment. I'm curious if 6.0 also behaves this way? (make sure to upgrade to 5.6.7!) -Steve

Sent from my iPad

On Jul 15, 2011, at 2:05 AM, Pena Kupen <kupen at wippies.fi> wrote:

> Hi again,
> 
> I'm answering to my by myself :-)
> 
> When I add to the end of my query "using unique" as:
> " as foobar using unique oid "
> then query is again running ok. I also tried it with older version of Mapserver (5.4.2). Both versions are working ok with it.
> 
> After some debugging of version 5.6.6, it seems to me , that in query, there is missing last right parenthesis if "using unique" is omitted. Some bug?
> 
> -Pena
> 
> Pena Kupen [kupen at wippies.fi] kirjoitti: 
>> Hello Carlos and all,
>> I'm using query, which is little cryptic.
>> location from (
>>   select h.location, h.oid, k.expla, h.date1, h.expla, h.total, ku.locationname as name       from       (select pa.location, ha.type_id as oid, ha.date1, pa_n.name, pa_n.location_id, ha.car_id, ha.total            from pa            join ha on ha.ha_pa_id = pa.pa_id            left join pa_n on pa.pa_id = pa_n.pa_id            where                ha.type_id = 121557 and                status='11' and                ha.is_valid is NULL
>>       ) as h
>>      left join ku on h.ku_id=ku.ku_id       left join k on h.type_id = k.type_id       where           k.code='sc' and           syno=false and           (h.ku_id = 'AAC')
>> ) as foobar
>> This has been used without any problem.
>> -Pena
>> Carlos Ruiz [boolean10001 at yahoo.com] kirjoitti: > Pena,
>> > > Can you post your query ?
>> > > You can use:
>> > > DATA "the_geom FROM <table>"in the traditional way
>> > > > Or, if you're using a query or a view datasource, you can use:
>> > > DATA "the_geom FROM <query>|<view> AS <alias> USING UNIQUE <column> USING SRID=<SRC>
>> > > Cheers from México
>> > > > IC Carlos Ruiz
>> > > > > ________________________________
>> > From: Pena Kupen <kupen at wippies.fi>
>> > To: mapserver-users at lists.osgeo.org
>> > Sent: Thursday, July 14, 2011 2:59 AM
>> > Subject: [mapserver-users] Using unique
>> > > Sorry doubleposting! There where little "copy/paste-error". You can ignore prior...
>> > > -Pena
>> > > > Hello all,
>> > > I'm just upgrading our system from mapserver 5.4.2 to 5.6.6.
>> > In some of our layer queries, I got now error:
>> > msPostGISParseData(): Query error. Error parsing PostGIS DATA variable. You must specifiy 'using unique' when supplying a subselect in the data definition.
>> > When using 5.4.2, this is not happaning and maps are working ok.
>> > > On mapserver/postgis manual (http://mapserver.org/input/vector/postgis.html) it says:
>> > The DATA parameter is used to specify the data used to draw the map. The form of DATA is 
[geometry_column] from [table_name|sql_subquery] using unique [unique_key] using srid=[spatial_reference_id]
. The 
using unique
 and 
using srid=
 clauses are optional, but using them improves performance.
>> > > Is this a bug or why I cannot anymore use queries without "using unique"?
>> > > -Pena
>> > > > -- Wippies-vallankumous on täällä! Varmista paikkasi vallankumouksen eturintamassa ja liity Wippiesiin heti!
>> > http://www.wippies.com/
>> > > _______________________________________________
>> > mapserver-users mailing list
>> > mapserver-users at lists.osgeo.org
>> > http://lists.osgeo.org/mailman/listinfo/mapserver-users
>> -- 
>> Wippies-vallankumous on täällä! Varmista paikkasi vallankumouksen eturintamassa ja liity Wippiesiin heti!
>> http://www.wippies.com/
>> _______________________________________________
>> mapserver-users mailing list
>> mapserver-users at lists.osgeo.org
>> http://lists.osgeo.org/mailman/listinfo/mapserver-users
> 
> 
> -- 
> Wippies-vallankumous on täällä! Varmista paikkasi vallankumouksen eturintamassa ja liity Wippiesiin heti!
> http://www.wippies.com/
> 
> _______________________________________________
> mapserver-users mailing list
> mapserver-users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/mapserver-users



More information about the MapServer-users mailing list