Attempt to use extra-lazy collections with PostgreSQL ends with invalid syntax exception:
ERROR: subquery in FROM must have an alias
The cause is that AbstractCollectionPersister.generateSelectSizeString fills sqlSelectSizeString query via SimpleSelect.toStatementString and it doesn't add an alias to query. Workaround is to append some alias in Dialect.appendLockHint, but not sure if it doesn't break other functionality.
Oh, just found out that a custom @Persister can be supplied, so better to override it as a workaround.
Is this still an issue in 4.0.1.Final? If so, please create a pull request (preferably) or attach a patch with an update to org.hibernate.test.extralazy.ExtraLazyTest that reproduces your issue.
No response received – closing.