Other subtype uses for CHAR/VARCHAR?

11 views
Skip to first unread message

Mark Rotteveel

unread,
Jul 12, 2026, 4:58:24 AM (2 days ago) Jul 12
to firebir...@googlegroups.com
Some of the system domains in RDB$FIELDS have subtypes greater than 1
for types 14 (CHAR) and 37 (VARCHAR). Specifically, types 2 and 3 occur.
What is their meaning?

Mark
--
Mark Rotteveel

Mark Rotteveel

unread,
Jul 12, 2026, 4:59:25 AM (2 days ago) Jul 12
to firebir...@googlegroups.com
On 12-07-2026 10:58, 'Mark Rotteveel' via firebird-devel wrote:
> Some of the system domains in RDB$FIELDS have subtypes greater than 1
> for types 14 (CHAR) and 37 (VARCHAR). Specifically, types 2 and 3 occur.
> What is their meaning?

See

select RDB$FIELD_NAME, RDB$FIELD_TYPE, RDB$FIELD_SUB_TYPE,
RDB$CHARACTER_SET_ID
from RDB$FIELDS
where RDB$FIELD_SUB_TYPE > 1
and RDB$FIELD_TYPE in (13, 37);

--
Mark Rotteveel

Mark Rotteveel

unread,
Jul 12, 2026, 5:13:15 AM (2 days ago) Jul 12
to firebir...@googlegroups.com
That should have been `in (14, 37)`. I think I should stop thinking for
the rest of the day...

Interestingly, 2 occurs with character set id 2 (ASCII), and 3 occurs
with character set id 4 (UTF8), and given previously types using UTF8,
used UNICODE_FSS (character set id 3), I wonder if there is some
relation there, especially as RDB$TYPES contains an entry SQL_TEXT with
id 3).

However, that then makes me wonder if SQL_TEXT shouldn't be changed to
ID 4 (as the SQL standard says: "SQL_TEXT is a character repertoire that
is an implementation-defined (IA016) subset of the repertoire of the
Universal Character Set that includes every <SQL language character> and
every character in every character set supported by the
SQL-implementation. The name of the default collation is SQL_TEXT;"

(And UNICODE_FSS is not that subset of "every character in every
character set supported by the SQL-implementation", as it misses a
significant part of UTF8).

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