Most RDBMS allow you to share exclusive locks on selected rows. For example, PostgreSQL has syntax like this:
SELECT * FROM post WHERE id=10 FOR SHARE;
Using FOR SHARE, we can obtain common locks even at the isolation level READ_COMMITTED, and we can avoid unpredictable read events without actually isolating the REPEATABLE_READ transaction.
But to prevent phantom from reading, SERIALIZABLE is the only way to do this. Why is there no explicit lock syntax for getting predicate locks?
As far as I know, I do not find that I saw such a construction in Oracle, SQL Server, MySQL or PostgreSQL.
source share