-
-
Notifications
You must be signed in to change notification settings - Fork 19
Description
Hello,
IDENTITY_TYPE is described as this on documentation (3.0 and 4.0) in Appendix D: System Tables:
NULL - not an identity column
0 - identity column, GENERATED BY
DEFAULT
1 - identity column, GENERATED ALWAYS
(not supported in Firebird 3.0, will be
introduced in Firebird 4.0)
it corresponds to https://www.ibexpert.net/ibe/pmwiki.php?n=Doc.IDENTITY:
"Currently, RDB$IDENTITY_TYPE always stores the value 0 (GENERATED BY DEFAULT) for identity columns and NULL for non-identity columns. In the future this column will be able to store the value 1 (GENERATED ALWAYS) when that type of identity column is supported by Firebird."
But:
https://firebirdsql.org/file/documentation/release_notes/html/en/3_0/rnfb30-ddl-enhance.html indicates:
"Currently, RDB$IDENTITY_TYPE will currently always store the value 1 (by default) for identity columns and NULL for non-identity columns. In the future this column will store the value 0, too (for ALWAYS) when Firebird implements support for this type of identity column. "
and above all in source code src/jrd/constants.h, we got:
enum IdentityType {
IDENT_TYPE_ALWAYS,
IDENT_TYPE_BY_DEFAULT
};
So IDENT_TYPE_ALWAYS = 0 and IDENT_TYPE_BY_DEFAULT = 1
Also in doc/sql.extensions/README.identity_columns.txt:
29 Implementation:
30 Two columns have been inserted in RDB$RELATION_FIELDS: RDB$GENERATOR_NAME and RDB$IDENTITY_TYPE.
31 RDB$GENERATOR_NAME stores the automatically created generator for the column. In RDB$GENERATORS,
32 the value of RDB$SYSTEM_FLAG of that generator will be 6. RDB$IDENTITY_TYPE will currently
33 always store the value 1 (by default) for identity columns and NULL for non-identity columns.
34 In the future this column will store the value 0, too (for ALWAYS) when Firebird support this type
35 of identity column.
I know that Firebird comes from a fork of Interbase so either there's a typo in https://www.ibexpert.net/ibe/pmwiki.php?n=Doc.IDENTITY and only Appendix D: System Tables should be fixed to indicated that the current is 1 and corresponds to identity type by default or we got a bug.