HHH-13106 : Fixes schema validation failure with PostgreSQL 10 #2880
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Few months ago, commit 1db476d included the fixes for HHH-12973. This commit also added the following change in
PostgreSQL81Dialect.javaFew months later, commit 76981d9 added support for default generated identity columns introduced in PostgreSQL 10. See HHH-13202 for details. Unfortunately
select * from information_schema.sequencesdoesn't return implicit sequences generated for default identity columns.The combined effect of these two changes was that the
SequenceInformationExtractor::extractMetadatareturned incorrect number of sequences. Especially, the implicit sequences were no longer visible to Hibernate. This resulted in HHH-13106 where settinghibernate.hbm2ddl.autotovalidatewould make application to fail with exception Schema-validation: missing sequence.This PR tried to find a common ground between these changes to restore expected behavior.