ubuntu22.04: COLLATION UNICODE for CHARACTER SET UTF8 is not installed

157 views
Skip to first unread message

李锐

unread,
Apr 28, 2024, 5:41:33 AM4/28/24
to firebird-support
I installed Firebird 5 both on windows 10 and ubuntu 22.04
I specified a character set when creating the database like this:
  create table TEST (
QUEUEID       INTEGER   not null,
TESTCODE         VARCHAR(64) COLLATE UNICODE_CI_AI
constraint PK_TEST  primary key (QUEUEID)
); 

But when I copied this database to  ubuntu 22.04  and ran it, it reported an error:

Exception: COLLATION UNICODE for CHARACTER SET UTF8 is not installed
An ICU library with collation version 153.88 is required but was not found. You may try to install ICU version 63.1, used to register the collation in this database or look for 'gfix -icu' in Firebird documentation.; InnerException1: COLLATION UNICODE for CHARACTER SET UTF8 is not installed
An ICU library with collation version 153.88 is required but was not found. You may try to install ICU version 63.1, used to register the collation in this database or look for 'gfix -icu' in Firebird documentation.;
   at FirebirdSql.Data.FirebirdClient.FbCommand.ExecuteReader(CommandBehavior behavior)
   at FirebirdSql.Data.FirebirdClient.FbCommand.ExecuteDbDataReader(CommandBehavior behavior)
   at System.Data.Common.DbCommand.System.Data.IDbCommand.ExecuteReader(CommandBehavior behavior)
   at System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)
   at System.Data.Common.DbDataAdapter.Fill(DataTable[] dataTables, Int32 startRecord, Int32 maxRecords, IDbCommand command, CommandBehavior behavior)
   at System.Data.Common.DbDataAdapter.Fill(DataTable dataTable)

I checked the reason, it's because the ICU version on Windows is 63; but on ubuntu 22.04, the default ICU version is 70;
I want it to run normally on ubuntu22.04. How can I solve this problem? Thanks!

Dimitry Sibiryakov

unread,
Apr 28, 2024, 5:44:33 AM4/28/24
to firebird...@googlegroups.com
李锐 wrote 28.04.2024 2:55:
> I checked the reason, it's because the ICU version on Windows is 63; but on
> ubuntu 22.04, the default ICU version is 70;
> I want it to run normally on ubuntu22.04. How can I solve this problem?

Use gfix with '-icu' switch.

--
WBR, SD.

Mark Rotteveel

unread,
Apr 28, 2024, 5:57:02 AM4/28/24
to firebird...@googlegroups.com
On 28/04/2024 02:55, 李锐 wrote:
> I installed Firebird 5 both on windows 10 and ubuntu 22.04
> I specified a character set when creating the database like this:
>   create table TEST (
> QUEUEID       INTEGER   not null,
> TESTCODE         VARCHAR(64) COLLATE UNICODE_CI_AI
> constraint PK_TEST  primary key (QUEUEID)
> );
>
> But when I copied this database to ubuntu 22.04  and ran it, it reported
> an error:

Don't copy databases between different OSes and hardware platforms, use
a gbak backup and restore.

Mark
--
Mark Rotteveel

Tomasz Dubiel

unread,
Apr 29, 2024, 3:50:09 AM4/29/24
to firebird-support
Can I ask why? Backup and restore takes time. gfix -icu is exactly for that:
" -icu switch

gfix has a new switch -icu to update ICU-dependent collations and rebuild dependent indices.

This can be used to make indices usable again when moving databases — without backup and restore — between Firebird instances using different ICU versions, or when the ICU version used by a Firebird instance changed (for example on Linux, when Firebird uses the ICU provided by the OS, and ICU was updated by an OS update)."

Best regards.

Mark Rotteveel

unread,
Apr 30, 2024, 7:44:46 AM4/30/24
to firebird...@googlegroups.com
On 29/04/2024 09:50, Tomasz Dubiel wrote:
> Can I ask why? Backup and restore takes time. gfix -icu is exactly for that:
> " -icu switch
>
> /gfix/ has a new switch -icu to update ICU-dependent collations and
> rebuild dependent indices.
>
> This can be used to make indices usable again when moving databases —
>  without backup and restore — between Firebird instances using different
> ICU versions, or when the ICU version used by a Firebird instance
> changed (for example on Linux, when Firebird uses the ICU provided by
> the OS, and ICU was updated by an OS update)."

Because it is possible when you switch between OSes, that you might also
switch hardware platforms, and the database file has some platform
specific things. Mostly big endian vs little endian, I think, but I'm
not sure if there might be other things (in the past 32-bit vs 64-bit
could even matter). That is one of the reasons Firebird records the
"Implementation" information on the header page, which for a database
file created on Windows x64 records:

HW=AMD/Intel/x64 little-endian OS=Windows CC=MSVC

Using gfix -icu might also be needed when moving a database between
different versions of the OS, or different (major) versions of Firebird
on the same OS, or if its system provided ICU library is upgraded.

For moves between different OSes, I'd recommend doing a backup and restore.

Mark
--
Mark Rotteveel

Reply all
Reply to author
Forward
0 new messages