[Qgis-user] Why does QGis autoincrement the integer key?

F T oukile at gmail.com
Fri Oct 18 01:45:37 PDT 2013


Hello,

Is there a way to avoid that QGis autoincrement the integer key of a
Postgis table?

I have a simple Postgis table that has a valuable integer key.
CREATE TABLE test.arret
(
  geom geometry,
  ide integer NOT NULL,
  nom_arret character varying(36),
  CONSTRAINT arret_pkey PRIMARY KEY (ide),
  CONSTRAINT enforce_dims_geom CHECK (st_ndims(geom) = 2),
  CONSTRAINT enforce_geotype_geom CHECK (geometrytype(geom) = 'POINT'::text
OR geom IS NULL),
  CONSTRAINT enforce_srid_geom CHECK (st_srid(geom) = 2154)
)
WITH (
  OIDS=TRUE
);

I want to enter the value of the key when I create a new point and it is
not possible with QGis (1.7.4).
When I create a new point and give it a value ide=1664, when the point is
saved in the database, the key is auto incremented and my value is ignored.

This behavior is not logical
Is there a way to put and integer key the value that is needed?

Thanks for your help

Fabrice
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20131018/a2c94b29/attachment.html>


More information about the Qgis-user mailing list