Add support for postgres collection-locking queries.

An experiment in supporting postgres.  If this works out I'll turn it into a proper bug and patch.