[postgis-users] PostGis 8.1 - error with "using unique"

Mark Cave-Ayland m.cave-ayland at webbased.co.uk
Fri Dec 2 01:20:29 PST 2005


> -----Original Message-----
> From: postgis-users-bounces at postgis.refractions.net [mailto:postgis-users-
> bounces at postgis.refractions.net] On Behalf Of jerome
> Sent: 02 December 2005 08:43
> To: davidtecher at yahoo.fr; PostGIS Users Discussion
> Subject: Re: [postgis-users] PostGis 8.1 - error with "using unique"

(cut)

> I've also created a new db, clean. I've imported a shp, I've created a
> gist index on the_geom column and tried the sames queries :
> 
> select * from comespvanregion  as foo using unique gid
> -> ERROR:  syntax error at or near "using" at character 41
> 
> select * from com_esp_van_region  as foo using unique
> geometry_columns.srid using SRID=27582
> -> ERROR:  syntax error at or near "using" at character 41
> 
> select * from com_esp_van_region  as foo using unique the_geom
> -> ERROR:  syntax error at or near "using" at character 41
> 
> If I try "select * from com_esp_van_region  as foo", It's works with
> pgAdmin & SQL manager, but my php script returns an error because it
> wants an OID column, that's not exist. With pgsql8.0.3, It works
> perfectly. Have you any idea of what I'm doing wrong ?
> 
> Thanks for your help and for your ressources on your web site for
> postgis. It's very helpfull.


Hi Jerome,

"using unique" and "using srid" are special reserved words which are used by
the Mapserver PostGIS connector in order to generate the real query which is
sent to PostGIS - they cannot be sent directly to the database.

If you have used shp2pgsql in order to import your shapefile then the only
change you should need to make to your application is to change your data
line to read:

$layer->set("data", $colonne_geometrique." from ".$table_choisie." using
unique gid");


Kind regards,

Mark.

------------------------
WebBased Ltd
17 Research Way
Plymouth
PL6 8BT

T: +44 (0)1752 797131
F: +44 (0)1752 791023

http://www.webbased.co.uk   
http://www.infomapper.com
http://www.swtc.co.uk  

This email and any attachments are confidential to the intended recipient
and may also be privileged. If you are not the intended recipient please
delete it from your system and notify the sender. You should not copy it or
use it for any purpose nor disclose or distribute its contents to any other
person.





More information about the postgis-users mailing list