Firebird 6 and SQL schemas¶
Firebird 6 adds SQL schemas: every table, view, procedure, function, package, trigger, sequence,
exception, domain and index belongs to a schema (PUBLIC by default, system objects to SYSTEM).
fbadmin supports them as follows. Firebird 6.0 has no final release yet, so it is tested against the
newest 6.0 build, the firebirdsql/firebird:6-snapshot image (6.0.0.2524 in November 2026). The
Firebird 6 CI jobs are required, like those for Firebird 3, 4 and 5: the backend tests with both
drivers, and the browser tests for schemas.
Object Explorer¶
For a Firebird 6 database, the tree gets a schema level:
Server
└─ Database
├─ APP ← schema
│ ├─ Tables
│ ├─ Views
│ └─ ...
├─ PUBLIC
└─ SYSTEM (system tables)
Each schema has its own object folders. Roles, users, shadows and BLOB filters are database-wide,
so they appear only under PUBLIC. Older servers keep the familiar Database → folders tree.
Selecting a node in a schema makes that schema the database's active schema:
- The properties, SQL and dependencies panels show that schema's object.
- Dialogs (create, alter, drop) work in that schema.
- A tab you open (data grid, Query Tool) keeps the schema it was opened in and switches back to it when you return to the tab.
Extracted DDL¶
- One object: the SQL tab and script menus prefix objects outside
PUBLICwithSET SEARCH_PATH TO <schema>, SYSTEM;. The unqualified names in the DDL, and in PSQL bodies, then resolve as they do in the source database. - Whole database: Tools → Extract DDL writes
CREATE SCHEMAstatements first. It then writes one block per schema,PUBLICfirst, each starting withSET SEARCH_PATH. Roles and role grants appear once; privileges are grouped with their schema. The script recreates the database exactly: a test extracts it, replays it into an empty database and compares.
Schema diff, data export and the ERD work on the active schema.
Query Tool¶
A Query Tool opened from a schema starts with SET SEARCH_PATH TO <schema>, SYSTEM. On Firebird 6
the toolbar shows a Schema picker for the session's search path. Changing it needs the
transaction to be committed or rolled back first.
Plans on Firebird 6 name tables with their schema (Table "PUBLIC"."ORD" Full Scan). The plan
viewer, the index advisor and the AI assistant's context all understand this form.
API¶
Requests that work on database metadata take an optional X-Fbadmin-Schema: <name> header. The
backend then:
- limits the catalog queries to that schema;
- sets the search path of its metadata connection for the request;
- opens Query Tool sessions with that search path.
GET /api/servers/{sid}/databases/{dbid}/schemas returns {supported, schemas}. On older servers it
returns supported: false. PUT /api/query/sessions/{id}/options accepts search_schema.
Known differences in the Firebird 6 snapshots¶
These are engine behaviours fbadmin works around. They may change before the 6.0 release. All of them were checked again on build 6.0.0.2524, and all still apply.
- Index lookups in system tables with a parameter (
WHERE RDB$RELATION_NAME = ?) find nothing. On Firebird 6, fbadmin's catalog inlines those values as quoted literals. - The profiler tables live in their own schema,
PLG$PROFILER. gstat -hrefuses a database in full shutdown. The header then reportsfullfrom the error.- Dropping and re-adding a UNIQUE constraint leaves an internal
RDB$TEMP_DEPEND_*index that cannot be dropped. fbadmin hides it. MON$COMPILED_STATEMENTSlists only statements cached by attachments that are still open.- The server reports versions as
LI-T6.0.0.…(Tfor test builds). - A dropped foreign key is still enforced after the drop is committed, even in new attachments ("violation of FOREIGN KEY constraint \"unknown\""), until the database is closed by every attachment. Anonymised copies that mask a key column referenced by a foreign key fail on Firebird 6 snapshots for now; copies without masked key columns work.
No new data types have shipped in the snapshots yet. The field types in RDB$TYPES match
Firebird 5.
New objects in Firebird 6¶
fbadmin finds each of these at runtime from the system tables. On Firebird 3, 4 and 5 the folders, fields and options below are not shown.
Tablespaces¶
A tablespace is a second file that holds tables and indices (CREATE TABLESPACE name FILE 'path'). The
database file itself is the tablespace PRIMARY.
- Tree: the folder Tablespaces (database-wide, like roles) lists them. The properties show the file, the owner and the tables and indices stored in it.
- Dialog: Create tablespace… and Edit tablespace… take the name, the file (a path on the server)
and a comment. Changing the file runs
ALTER TABLESPACE … SET FILE TO: this only updates the path stored in the database, so move the file yourself with the database shut down. - Table designer, constraint and index dialogs: a Tablespace list appears once the database has a
tablespace. Changing it for an existing table or index moves it (
ALTER TABLE … SET TABLESPACE TO,ALTER INDEX … SET TABLESPACE TO); nothing is dropped. Moving a table copies its data and leaves its indices where they are. - Drop: the server refuses to drop a tablespace that still holds something. The drop preview lists those tables and indices; move them first.
Firebird creates an index, and the index of a key, in the tablespace of its table unless the statement
names another. fbadmin therefore always writes the clause for an index of a table that is in a
tablespace, TABLESPACE PRIMARY included, so a script puts every index back where it was.
Constants in packages¶
CONSTANT name type = value; in a package header (public) or body (private). The package properties
list the constants with their type and value. The package source already declares them, so the DDL adds
only their comments (COMMENT ON CONSTANT package.name), which you edit under Comments… on the
package.
Aggregate functions¶
CREATE AGGREGATE FUNCTION with ON ACCUMULATE DO and ON GROUP DO blocks. The function list and the
properties mark them, and their DDL uses CREATE OR ALTER AGGREGATE FUNCTION. The function dialog has
an Aggregate function box. The server cannot alter a scalar function into an aggregate or back, so
the dialog and the schema diff drop the function and create it again, and say so in a warning.
Local temporary tables¶
CREATE LOCAL TEMPORARY TABLE makes a table that only the connection that created it can see; it is
not in RDB$RELATIONS. The folder Local Temporary Tables reads MON$LOCAL_TEMPORARY_TABLES and
lists the tables of every open connection as NAME #attachment, with their columns, the user and a
CREATE script. They are read-only in the tree: only the connection that owns one can read or drop it.
The monitoring table does not report a BLOB column's sub type, so those columns show as BLOB.
DDL extract and schema diff¶
- The extract creates the tablespaces before the tables, writes the
TABLESPACEclauses, usesCREATE AGGREGATE FUNCTIONfor aggregates and adds the comments on tablespaces and constants. - The diff creates missing tablespaces first and drops removed ones last. A table, key or index that differs only in its tablespace is moved, not recreated.
- A tablespace is a file on one server. The migration script names the file of the source database and warns about it: change the path before you run the script on the same server. When both databases have the tablespace but with different files, the diff reports it and changes nothing.
Engine behaviour to know about¶
After DROP TABLESPACE, the connections that were open before fail on the monitoring tables
(TABLESPACE (id=…)) until they reconnect (build 6.0.0.2524). fbadmin replaces its own metadata
connections after it runs the statement; an open Query Tool tab may need a reconnect.
Running the tests against Firebird 6¶
scripts/test-servers.sh # also starts fb6 (6-snapshot) on port 3056
FBADMIN_TEST_PORT=3056 pytest -q backend/tests
cd e2e && FB6_PORT=3056 npx playwright test # schemas.spec.ts is skipped without Firebird 6 (FB6_REQUIRED=1: it fails)