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

Jose Gomez-Dans jgomezdans at gmail.com
Thu Mar 29 14:50:07 PDT 2007


Hi Steve,

On 3/29/07, Stephen Woodbridge <woodbri at swoodbridge.com> wrote:
> 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?

This is true, and I have that column. The problem is that when I do a
GeometryUnion, the column has doubles which appear several times (each
feature is split by the second layer in the union), so the value is no
longer unique. While I want to keep the reference to the original
feature, the new "index" still needs to be different. A way I see is
to add a field to the view that identifies the "row number" (like the
SERIAL fields. But these are for tables not views right?).

Thanks!
Jose



More information about the postgis-users mailing list