In hibernate.cfg.xml, the PostgreSQL configuration has this comment:
if you want the main wiki database to be different than “xwiki” (or “public” in schema mode)
you will also have to set the property xwiki.db in xwiki.cfg file
So, I’ve got hibernate.connection.url ending with :5432/production-xwiki and I’ve set xwiki.db thus:
xwiki.db=production-xwiki
However, attempting to access XWiki results in several exceptions, like:
com.xpn.xwiki.XWikiException: Error number 3301 in 3: Exception while switching to database xwiki
all of which mention “database xwiki”.
Can XWiki be configured to use a database name other than xwiki or is it hard-wired? I’ve reported a similar issue with the Docker image but I’m now getting this on an installation of the Debian packages.
I use this setup every day with MySQL so it definitely works fine.
Could you paste the complete error ? Changing the database name does not change the id of the main wiki but creates a mapping between xwiki and the actual database so seeing reference to xwiki is expected.
But one thing I see in the mapping code is that “-” is automatically replaced with “_” because it’s not supported by many databases so maybe that’s your issue here. I guess it should be modified to clean only subwikis instead and trust configured main wiki (would be great if you could create an issue about that in Loading... if you feel that you need the “-”).