Migration FB3- > FB5: NCHAR instead of VCHAR ?

46 views
Skip to first unread message

Nikolaus Kern

unread,
May 23, 2025, 3:31:26 AM5/23/25
to firebird-support
Hello,

I have migrated some databases from Firebird 3x to 5. using a backup and restore cycle.

Now I have recognized that all VCHAR() fields have been migrated to NCHAR VARYING().

The databases have the charset ISO8859_1. I would like to move to UTF-8 but don´t like the effort...

1. Is this change a problem?
2. Do I need to take a different behaviour under consideration?
3. Is there an easy way to move to UTF-8?

Thanks

Niko

Dimitry Sibiryakov

unread,
May 23, 2025, 4:37:55 AM5/23/25
to firebird...@googlegroups.com
Nikolaus Kern wrote 23.05.2025 9:31:
> Now I have recognized that all VCHAR() fields have been migrated to NCHAR VARYING().
>
> The databases have the charset ISO8859_1.

And this is exactly definition of NCHAR in Firebird: string fields having
character set ISO 8859-1.

--
WBR, SD.

Nikolaus Kern

unread,
May 23, 2025, 5:23:21 AM5/23/25
to firebird-support
Hello,

this statement in the document sounds for me that NCHAR has also the character of CHAR: "NCHAR is a fixed-length character data type with the ISO8859_1 character set. In all other respects it is
the same as CHAR."

CHAR does pad blankes by the end of the string, while VCHAR does not do this.

Niko

Dimitry Sibiryakov

unread,
May 23, 2025, 5:24:50 AM5/23/25
to firebird...@googlegroups.com
Nikolaus Kern wrote 23.05.2025 11:23:
> this statement in the document sounds for me that NCHAR has also the character
> of CHAR: "NCHAR is a fixed-length character data type with the ISO8859_1
> character set. In all other respects it is
> the same as CHAR."

Yes, but "NCHAR" and "NCHAR VARYING" are two different types.

--
WBR, SD.

Mark Rotteveel

unread,
May 23, 2025, 3:21:47 PM5/23/25
to firebird...@googlegroups.com
There is no such thing as VCHAR, there is VARCHAR a.k.a. CHARACTER
VARYING. Firebird doesn't really have NCHAR/NCHAR VARYING, that is just
an alias for CHAR/VARCHAR CHARACTER SET ISO8859_1.

It looks like you're using a tool that displaying NCHAR VARYING if the
columns is VARCHAR CHARACTER SET ISO8859_1.

Mark
--
Mark Rotteveel
Reply all
Reply to author
Forward
0 new messages