FirebirdSQL logo

When you create a database, the Firebird engine creates a lot of system tables.Metadata — the descriptions and attributes of all database objects — are stored in these system tables.

System table identifiers all begin with the prefix RDB$.

List of System Tables
[fblangref-appx04-authmapping]

Stores authentication and other security mappings

[fblangref-appx04-backuphistory]

History of backups performed using nBackup

[fblangref-appx04-charactersets]

Names and describes the character sets available in the database

[fblangref-appx04-chkconstraints]

Cross-references between the names of constraints (NOT NULL constraints, CHECK constraints and ON UPDATE and ON DELETE clauses in foreign key constraints) and their associated system-generated triggers

[fblangref-appx04-collations]

Collations for all character sets

[fblangref-appx04-config]

Virtual table with configuration settings applied for the current database

[fblangref-appx04-database]

Basic information about the database

[fblangref-appx04-dbcreators]

A list of users granted the CREATE DATABASE privilege when using the specified database as a security database

[fblangref-appx04-dependencies]

Information about dependencies between database objects

[fblangref-appx04-exceptions]

Custom database exceptions

[fblangref-appx04-fields]

Column and domain definitions, both system and custom

[fblangref-appx04-fielddims]

Dimensions of array columns

[fblangref-appx04-files]

Information about secondary files and shadow files

[fblangref-appx04-filters]

Information about BLOB filters

[fblangref-appx04-formats]

Information about changes in the formats of tables

[fblangref-appx04-functions]

Information about external functions

[fblangref-appx04-funcargs]

Attributes of the parameters of external functions

[fblangref-appx04-generators]

Information about generators (sequences)

[fblangref-appx04-idxsegments]

Segments and index positions

[fblangref-appx04-indices]

Definitions of all indexes in the database (system- or user-defined)

[fblangref-appx04-logfiles]

Not used in the current version

[fblangref-appx04-packages]

Stores the definition (header and body) of SQL packages

[fblangref-appx04-pages]

Information about database pages

[fblangref-appx04-procedures]

Definitions of stored procedures

[fblangref-appx04-procparams]

Parameters of stored procedures

[fblangref-appx04-refconstr]

Definitions of referential constraints (foreign keys)

[fblangref-appx04-relations]

Headers of tables and views

[fblangref-appx04-relconstr]

Definitions of all table-level constraints

[fblangref-appx04-relfields]

Top-level definitions of table columns

[fblangref-appx04-roles]

Role definitions

[fblangref-appx04-secclasses]

Access control lists

[fblangref-appx04-timezones]

Time zones

[fblangref-appx04-transacs]

State of multi-database transactions

[fblangref-appx04-triggers]

Trigger definitions

[fblangref-appx04-trigmsgs]

Trigger messages

[fblangref-appx04-types]

Definitions of enumerated data types

[fblangref-appx04-userprivs]

SQL privileges granted to system users

[fblangref-appx04-viewrelns]

Tables that are referred to in view definitions: one record for each table in a view

RDB$AUTH_MAPPING

RDB$AUTH_MAPPING stores authentication and other security mappings.

Column Name Data Type Description

RDB$MAP_NAME

CHAR(63)

Name of the mapping

RDB$MAP_USING

CHAR(1)

Using definition:

P - plugin (specific or any)
S - any plugin serverwide
M - mapping
* - any method

RDB$MAP_PLUGIN

CHAR(63)

Mapping applies for authentication information from this specific plugin

RDB$MAP_DB

CHAR(63)

Mapping applies for authentication information from this specific database

RDB$MAP_FROM_TYPE

CHAR(63)

The type of authentication object (defined by plugin) to map from, or * for any type

RDB$MAP_FROM

CHAR(255)

The name of the authentication object to map from

RDB$MAP_TO_TYPE

SMALLINT

The type to map to

0 - USER
1 - ROLE

RDB$MAP_TO

CHAR(63)

The name to map to

RDB$SYSTEM_FLAG

SMALLINT

Flag:

0 - user-defined
1 or higher - system-defined

RDB$DESCRIPTION

BLOB TEXT

Optional description of the mapping (comment)

RDB$EXCEPTIONS

RDB$EXCEPTIONS stores custom database exceptions.

Column Name Data Type Description

RDB$EXCEPTION_NAME

CHAR(63)

Custom exception name

RDB$EXCEPTION_NUMBER

INTEGER

The unique number of the exception assigned by the system

RDB$MESSAGE

VARCHAR(1021)

Exception message text

RDB$DESCRIPTION

BLOB TEXT

Could store text description of the exception

RDB$SYSTEM_FLAG

SMALLINT

Flag:

0 - user-defined
1 or higher - system-defined

RDB$SECURITY_CLASS

CHAR(63)

May reference a security class defined in the table RDB$SECURITY_CLASSES, to apply access control limits to all users of this exception

RDB$OWNER_NAME

CHAR(63)

The username of the user who created the exception originally

RDB$FIELDS

RDB$FIELDS stores definitions of columns and domains, both system and custom.This is where the detailed data attributes are stored for all columns.

Note

The column RDB$FIELDS.RDB$FIELD_NAME links to RDB$RELATION_FIELDS.RDB$FIELD_SOURCE, not to RDB$RELATION_FIELDS.RDB$FIELD_NAME.

Column Name Data Type Description

RDB$FIELD_NAME

CHAR(63)

The unique name of the domain created by the user or of the domain automatically built for the table column by the system.System-created domain names start with the “RDB$” prefix

RDB$QUERY_NAME

CHAR(63)

Not used

RDB$VALIDATION_BLR

BLOB BLR

The binary language representation (BLR) of the expression of the CHECK constraint of a domain

RDB$VALIDATION_SOURCE

BLOB TEXT

The original source text in the SQL language specifying the check of the CHECK value

RDB$COMPUTED_BLR

BLOB BLR

The binary language representation (BLR) of the expression of a COMPUTED BY column, used to calculate the value of a computed column when it is accessed.

RDB$COMPUTED_SOURCE

BLOB TEXT

The original source text of the expression that defines a COMPUTED BY column

RDB$DEFAULT_VALUE

BLOB BLR

The binary language representation (BLR) of the default value for the field or domain

RDB$DEFAULT_SOURCE

BLOB TEXT

The default value in the source code, as an SQL constant or expression

RDB$FIELD_LENGTH

SMALLINT

Column size in bytes.BOOLEAN occupies 1 byte.FLOAT, DATE, TIME, INTEGER occupy 4 bytes.DOUBLE PRECISION, BIGINT, TIMESTAMP, TIME WITH TIME ZONE, DECFLOAT(16) and BLOB identifiers occupy 8 bytes.TIMESTAMP WITH TIME ZONE occupies 12 bytes.INT128 and DECFLOAT(34) occupy 16 bytes.For the CHAR and VARCHAR data types, the column stores the maximum number of bytes specified when a string domain (column) is defined

RDB$FIELD_SCALE

SMALLINT

The negative number that specifies the scale for DECIMAL and NUMERIC columns — the number of digits after the decimal point

RDB$FIELD_TYPE

SMALLINT

Data type code for the column:

7 - SMALLINT
8 - INTEGER
10 - FLOAT
12 - DATE
13 - TIME
14 - CHAR
16 - BIGINT
23 - BOOLEAN
24 - DECFLOAT(16)
25 - DECFLOAT(34)
26 - INT128
27 - DOUBLE PRECISION
28 - TIME WITH TIME ZONE
29 - TIMESTAMP WITH TIME ZONE35 - TIMESTAMP
37 - VARCHAR
261 - BLOB

Codes for DECIMAL and NUMERIC are the same as for the integer types used for storage.

RDB$FIELD_SUB_TYPE

SMALLINT

Specifies the subtype for the BLOB data type:

0 - untyped (binary)
1 - text
2 - BLR
3 - access control list
4 - reserved for future use
5 - encoded table metadata description
6 - for storing the details of a cross-database transaction that ends abnormally
7 - external file description
8 - debug information (for PSQL)
< 0 - user-defined

Specifies for the CHAR data type:

0 - untyped data
1 - fixed binary data

Specifies the particular data type for the integer data types (SMALLINT, INTEGER, BIGINT, INT128) and for fixed-point numbers (NUMERIC, DECIMAL):

0 or NULL - the data type matches the value in the RDB$FIELD_TYPE field
1 - NUMERIC
2 - DECIMAL

RDB$MISSING_VALUE

BLOB BLR

Not used

RDB$MISSING_SOURCE

BLOB TEXT

Not used

RDB$DESCRIPTION

BLOB TEXT

Any domain (table column) comment text

RDB$SYSTEM_FLAG

SMALLINT

Flag: the value of 1 means the domain is automatically created by the system, the value of 0 means that the domain is defined by the user

RDB$QUERY_HEADER

BLOB TEXT

Not used

RDB$SEGMENT_LENGTH

SMALLINT

Specifies the length of the BLOB buffer in bytes for BLOB columns.Stores NULL for all other data types

RDB$EDIT_STRING

VARCHAR(127)

Not used

RDB$EXTERNAL_LENGTH

SMALLINT

The length of the column in bytes if it belongs to an external table.Always NULL for regular tables

RDB$EXTERNAL_SCALE

SMALLINT

The scale factor of an integer-type field in an external table;represents the power of 10 by which the integer is multiplied

RDB$EXTERNAL_TYPE

SMALLINT

The data type of the field as it is represented in an external table:

7 - SMALLINT
8 - INTEGER
10 - FLOAT
12 - DATE
13 - TIME
14 - CHAR
16 - BIGINT
23 - BOOLEAN
24 - DECFLOAT(16)
25 - DECFLOAT(34)
26 - INT128
27 - DOUBLE PRECISION
28 - TIME WITH TIME ZONE
29 - TIMESTAMP WITH TIME ZONE35 - TIMESTAMP
37 - VARCHAR
261 - BLOB

RDB$DIMENSIONS

SMALLINT

Defines the number of dimensions in an array if the column is defined as an array.Always NULL for columns that are not arrays

RDB$NULL_FLAG

SMALLINT

Specifies whether the column can take an empty value (the field will contain NULL) or not (the field will contain the value of 1)

RDB$CHARACTER_LENGTH

SMALLINT

The length of CHAR or VARCHAR columns in characters (not in bytes)

RDB$COLLATION_ID

SMALLINT

The identifier of the collation for a character column or domain.If it is not defined, the value of the field will be 0

RDB$CHARACTER_SET_ID

SMALLINT

The identifier of the character set for a character column, BLOB TEXT column or domain

RDB$FIELD_PRECISION

SMALLINT

Specifies the total number of digits for the fixed-point numeric data type (DECIMAL and NUMERIC).The value is 0 for the integer data types, NULL is for other data types

RDB$SECURITY_CLASS

CHAR(63)

May reference a security class defined in the table RDB$SECURITY_CLASSES, to apply access control limits to all users of this domain

RDB$OWNER_NAME

CHAR(63)

The username of the user who created the domain originally