Subject Re: [ib-support] format version number ??
Author Paul Beach
> dear Ann,
> what is the format version number ?

Stored in rdb$formats (a system table)

"RDB$FORMATS keeps track of the formats of the columns to a table.
Firebird/InterBase assigns the table a new format number at each change to a
column definition. This table allows existing application programs to access
a changed table, without needing to be re-compiled"

Or so the doc's say.... loosely put every time you change a metadata object
in the database that can be changed on-line i.e. versioned, then the format
will increment by one. This way for example, records in a table know which
format is applied to them.

from: http://www.ibphoenix.com/ibp_ods_page.html

When a field is added or dropped, or the datatype of a field is changed, a
new format is generated for that table. A history of all of the formats for
a table is stored in RDB$FORMATS. This allows the database to reconstruct
records that were stored at any time based on the format that existed for
the table at that time. Metadata changes, do not directly affect the records
when the metadata change itself takes place, only when the records are
actually next visited.

> what happens if it increases above limit of 256?

You get an error something like:

Error 607 "Unsucessful metadata update - TABLE - too many versions"

Then you need to backup and restore your database.

If I remember rightly, and I am sure Ann will step in and correct me if I am
wrong. System metadata is also subject to grabage collection, so its
possible that you could make 255+ changes over time and not see the error,
assuming of course that the metadata was garbage collected before the 255
limit was reached.

Regards
Paul Beach
Main Tel (UK):+44 (0) 1844 354465
Mobile: (UK): +44 (0) 7764 188603
http://www.ibphoenix.com
For all your upto date Firebird and
InterBase information