[Tile-serving] [osm2pgsql] unique ids - force (#446)

Rory McCann notifications at github.com
Thu Sep 3 08:28:03 UTC 2015


Just for the record, you can add a unique id to a table in PostgreSQL with this SQL query:

    ALTER TABLE tablename ADD COLUMN gid SERIAL UNIQUE;

This will add a new column (`gid`) and populate it with new, unique, values. Updating the database by applying a diff will still work, and new rows will have new, unique, values.

---
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/osm2pgsql/issues/446#issuecomment-137377750
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/tile-serving/attachments/20150903/047fd6e0/attachment.html>


More information about the Tile-serving mailing list