Domains in computed fields

16 views
Skip to first unread message

em...@tot-consult.com

unread,
Jun 26, 2025, 2:57:56 AM6/26/25
to firebird-support
It seems it is not allowed to use domains as type for computed fields. The following test produces an error (Firebird 5.0.2 on Windows):

SQL> create domain var8 as varchar(8);
SQL>
SQL> create table test(
CON> id var8 primary key,
CON>  f1 varchar(8) computed by (id),
CON>  f2 computed by(id),
CON>  f3 var8 computed by (id)
CON>  );
Statement failed, SQLSTATE = 42000
Dynamic SQL Error
-SQL error code = -104
-Token unknown - line 5, column 10
-computed

It works with the generic data type and without type specification, but not with the domain. Is there any special reason for this, or it can be considered a bug? (At least in the documentation).

Mark Rotteveel

unread,
Jun 26, 2025, 3:13:18 AM6/26/25
to firebird...@googlegroups.com
I think it is a bug in Firebird, but it could be it's intentional. The
"problem" is that the grammar for computed columns uses `non_array_type`
where it probably should be using `domain_or_non_array_type_name`.

I'd suggest reporting a bug on
https://github.com/FirebirdSQL/firebird/issues

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