Wiki source code of "Hibernate Sequence already Exists" PostgreSQL Warning
Last modified by Eleni Cojocariu on 2026/11/25 14:50
Show last authors
| author | version | line-number | content |
|---|---|---|---|
| 1 | When starting XWiki with PostgreSQL, you may encounter the following message in the PostgreSQL logs: | ||
| 2 | |||
| 3 | {{code language="none"}} | ||
| 4 | Relation "hibernate_sequence" already exists | ||
| 5 | {{/code}} | ||
| 6 | |||
| 7 | === Cause === | ||
| 8 | |||
| 9 | XWiki lets Hibernate generate the identifiers of a few tables, and on PostgreSQL and Oracle Hibernate does that from a sequence named ##hibernate_sequence##. Hibernate would normally create that sequence itself when it updates the schema, but because of [[HHH-13464>>https://hibernate.atlassian.net/browse/HHH-13464]] it skips the creation as soon as a sequence of that name exists in //any// schema, which leaves subwikis without one. XWiki therefore creates the sequence itself, in {{scm path="xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/internal/store/hibernate/HibernateStore.java"}}##HibernateStore##{{/scm}}: it first asks the schema whether the sequence is already there and skips the creation if it is, and only when that query itself fails does it attempt the creation blindly. PostgreSQL then logs this message, which was reported as [[XWIKI-14055>>https://jira.xwiki.org/browse/XWIKI-14055]] and closed as //won't fix// because it is harmless. | ||
| 10 | |||
| 11 | === Solution === | ||
| 12 | |||
| 13 | No action is required. XWiki does not report the failed creation as an error in this case, and the wiki starts and operates normally. |