What is the best value to use for id in an ActiveRecord pattern (PHP).
auto-increment is out of the question. I would like to generate an id value that I can use to create a new record, but will be unique.
random values have a chance of creating collision.
querying to get the last id used, and then incrementing that value has the chance that another record will be created at approximately the same time with the same id value.
what do most use in this situation? what is the best thing to use for this situation?
INSERT ... RETURNING idpostgresql.org/docs/8.2/static/sql-insert.html). not sure if that's applicable to you though, but it sounds like you may not have a db solution decided on yet...