[postgis-users] Creating an ID field in a view

Stephen Woodbridge woodbri at swoodbridge.com
Thu Mar 29 13:37:02 PDT 2007


Jose,

It sounds like you need a persistent value. In this case you have to 
probably add a column to one of your existing tables and expose it in 
your view. How else will you be able to uniquely identify a row of data?

-Steve

Jose Gomez-Dans wrote:
> Hi Mark,
> 
> 
> On 3/29/07, Mark Cave-Ayland <mark.cave-ayland at ilande.co.uk> wrote:
>> > for my own purposes), I need to create an unique field per feature. Is
>> > there some function which will add this field and populate it
>> > accordingly? I am not interested in its value, only in the fact that
>> > it has to be unique for each feature in the view.
>> If you don't care if the value changes each time you run the query,
>> simply create a sequence and reference it in your SELECT, e.g.
> 
> Mmmm, this would be OK for just throwing the data into QGIS to view
> it. However, I would also like to do some work with it, so the value
> would need to be "static" (i.e., it should not change when I run the
> query). However, the tip is useful :)
> 
> Cheers,
> Jose
> _______________________________________________
> postgis-users mailing list
> postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users




More information about the postgis-users mailing list