Commented out Gustaf's broken version of db_nextval, and replaced it with the slower, but *correct*, earlier version. The "improved" version can be commented back in locally for those who don't care about correctness. Or it can be corrected and put back in if someone cares to fix it.
Get rid of the postgres warning "adding missing FROM-clause entry " on sequences Make "db_nextval acs_object_id_seq" more than twice as fast (from 948 microseconds to 378 microseconds)