I do not believe PG 2.0 is supported in QGIS 1.6.  I had a similar error when I had tried.  It does work well using QGIS 1.7 or greater.<br><br>- John<br><br>
<br><br><div class="gmail_quote">On Mon, Jul 18, 2011 at 7:45 PM, Vishal Mehta <span dir="ltr"><<a href="mailto:vishal.mehta@sei-us.org">vishal.mehta@sei-us.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div link="blue" vlink="purple" lang="EN-US"><div><p class="MsoNormal">Hi all,<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">I’m using Quantum GIS 1.6.0, <u></u><u></u></p><p class="MsoNormal">
Postgresql 9.0 and <u></u><u></u></p><p class="MsoNormal">Postgis 2.0 (dev version)<i><u></u><u></u></i></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">On Windows 7.<u></u><u></u></p><p class="MsoNormal">
<u></u> <u></u></p><p class="MsoNormal">I’m having trouble adding a Postgis layer to QGIS. I loaded a shapefile into my database separately using the shapefile loader and that seemed to woork fine. However when I try to bring it into QGIS I get the following error:<u></u><u></u></p>
<p class="MsoNormal" style="margin-left:.5in"><i><span style="font-size:12.0pt;font-family:"Times New Roman","serif"">1 cursor states lost.<u></u><u></u></span></i></p><p class="MsoNormal" style="margin-left:.5in">
<i><span style="font-size:12.0pt;font-family:"Times New Roman","serif"">SQL: declare qgisf1 binary cursor for select "gid",asbinary("geom",'NDR') from "public"."wardscleanattributes" where "geom" && setsrid('BOX3D(-1.2547169811320755 -1.0000000000000000, 1.2547169811320755 1.0000000000000000)'::box3d,-1)<u></u><u></u></span></i></p>
<p class="MsoNormal" style="margin-left:.5in"><i><span style="font-size:12.0pt;font-family:"Times New Roman","serif"">Result: 7 (ERROR: function asbinary(geometry, unknown) does not exist<u></u><u></u></span></i></p>
<p class="MsoNormal" style="margin-left:.5in"><i><span style="font-size:12.0pt;font-family:"Times New Roman","serif"">LINE 1: declare qgisf1 binary cursor for select "gid",asbinary("geom...<u></u><u></u></span></i></p>
<p class="MsoNormal" style="margin-left:.5in"><i><span style="font-size:12.0pt;font-family:"Times New Roman","serif"">^<u></u><u></u></span></i></p><p class="MsoNormal" style="margin-left:.5in"><i><span style="font-size:12.0pt;font-family:"Times New Roman","serif"">HINT: No function matches the given name and argument types. You might need to add explicit type casts.<u></u><u></u></span></i></p>
<p class="MsoNormal" style="margin-left:.5in"><i><span style="font-size:12.0pt;font-family:"Times New Roman","serif"">)<u></u><u></u></span></i></p><p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif""><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif"">The layer has a gist index, as well as a serial, primary key column.<u></u><u></u></span></p><p class="MsoNormal">
<span style="font-size:12.0pt;font-family:"Times New Roman","serif"">The same procedure used to work fine with<u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif"">QGIS 1.0.2 – postgresql 8.3 and postgis 1.5<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif""><u></u> <u></u></span></p><p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif"">Help?<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif"">Vishal<u></u><u></u></span></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal"><u></u> <u></u></p></div></div><br>_______________________________________________<br>
Qgis-user mailing list<br>
<a href="mailto:Qgis-user@lists.osgeo.org">Qgis-user@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/qgis-user" target="_blank">http://lists.osgeo.org/mailman/listinfo/qgis-user</a><br>
<br></blockquote></div><br>