-----"Qgis-user" <qgis-user-boun...@lists.osgeo.org> a écrit : -----
De : Árni Geirsson
Envoyé par : "Qgis-user"
Date : 12/04/2017 07:13
Cc: "qgis-user@lists.osgeo.org" <qgis-user@lists.osgeo.org>
Objet : Re: [Qgis-user] Unique IDs in a PostGIS view
Alta ehf // +354 582 5000 // +354 897 9549
I’ve used something like this to get unique Ids:
SELECT row_number() OVER (ORDER BY s.omrade_id, s.kod) AS id, …. ORDER BY s.omrade_id, s.kod;
If the ordering isn’t necessary I guess you can skip that.
https://www.postgresql.org/
docs/current/static/functions- window.html
Karl-Magnus Jönsson
Från: Qgis-user [mailto:qgis-user-bounces@
lists.osgeo.org ] För Árni Geirsson
Skickat: den 12 april 2017 11:34
Till: qgis-user@lists.osgeo.org
Ämne: [Qgis-user] Unique IDs in a PostGIS view
I am trying to create a view that extracts vertices from lines using ST_DumpPoints and to get unique IDs I have set up a sequence to generate the numbers using nextval(). The query executes normally in the DB Mananger and I see the results as a table in the table view. However, when I attempt to load the results of the view as a layer in QGIS, I get an error: "Database error: ERROR: cannot execute nextval() in a read-only transaction". No features are loaded.
Are there any smart tricks out there to work around this or other means of generating the IDs?
Árni Geirsson
Qgis-user mailing list
Qgis-user@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user
Si vous n'êtes pas le destinataire de ce message, veuillez le détruire près avoir informé l'expéditeur de son erreur. Par ailleurs, il est interdit de copier ou de modifier ce courriel sans l'autorisation de l'auteur.
L'Institut national de santé publique du Québec n'assume aucune responsabilité à l'égard du contenu des messages personnels envoyés par ses employés.
_______________________________________________ Qgis-user mailing list Qgis-user@lists.osgeo.org List info: https://lists.osgeo.org/mailman/listinfo/qgis-user Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user