[postgis-users] shp2pgsql Primary Key

Jeff Lounsbury jeffloun at refractions.net
Fri Feb 14 16:33:38 PST 2003


There has been a request to make the 'gid' column in the table shp2pgsql
creates into the primary key. The issue with this is that it takes a
little more thinking to try to avoid duplicating the gid when you append
data to that table after you create it.

My only idea at this point is to add a 'create sequence ...' line into
the program when run in table creation mode and then use the next value
of the sequence all the time. Seems like a decent idea to me until i
realized I would be instantly ruining everyone's life who ever wants to
use the new shp2pgsql program with an old table created by the previous
shp2pgsql (because the next value statement would look for a seq that
didn't exist).

What do people think? Would it really really suck if you couldn't append
to old tables with the new version or does nobody ever do that anyways?
-Jeff




More information about the postgis-users mailing list