[Qgis-developer] QGIS w/ postgis 1.1.2

Stephan Holl holl at gdf-hannover.de
Tue Jul 4 06:29:01 EDT 2006


Dear devs,

I have set up a fresh env using PostGIS 1.1.2 on Postgresql 8.1 (debian
testing) and QGIS Preview1 Release (selfcompiled).

My environment:
SELECT postgis_full_version();
POSTGIS="1.1.2" GEOS="2.2.1-CAPI-1.0.1" PROJ="Rel. 4.4.9, 29 Oct 2004"
USE_STATS (1 Zeile)

SELECT version();
 PostgreSQL 8.1.4 on x86_64-pc-linux-gnu, compiled by GCC cc (GCC)
4.0.4 20060507 (prerelease) (Debian 4.0.3-3) (1 Zeile)

QGIS refuses to load data without OIDs (which is disabled by default in
Postgres8).

The error is the following:
The table has no column suitable for use as a key.

Qgis requires that the table either has a column of type
int4 with a unique constraint on it (which includes the
primary key) or has a PostgreSQL oid column.

In the debug-output it seems it is looking for an OID-column, but my
database does not have them enabled.
As stated creating a unique index manually makes QGIS able to load
the dataset. 

Aparently it fails of neither OIDs nor indexes are available for the
data.
I have imported the data with v.out.ogr from GRASS which does not
create a unique index nor a uniqze constraint on the id-column
(ogc_fid).

I do not have much insight in the postgres-stuff but I like to have a
nice and easy solution to make it easy to show imported datasets in
PostGIS from QGIS. I am not quite sure if this is a QGIS problem or
even a GRASS (v.out.ogr) problem which does not create an index. Going
save would be just add a unique constraint on the ogc_fid-column which
should be done by OGR?!

Best regards

	Stephan

-- 
GDF Hannover - Solutions for spatial data analysis and remote sensing
Hannover Office      -     Mengendamm 16d      -     D-30177 Hannover
Internet: www.gdf-hannover.de      -      Email: holl at gdf-hannover.de
Phone : ++49-(0)511.39088507       -        Fax: ++49-(0)511.39088508



More information about the Qgis-developer mailing list