CREATE DATABASE

<< COMMENT | FB 2.5 Language Reference | ALTER DATABASE >>

CREATE DATABASE

Available in: DSQL, ESQL

Syntax (partial)

 CREATE {DATABASE | SCHEMA}
    ...
    [PAGE_SIZE [=] size]
    ...
    [DEFAULT CHARACTER SET charset [COLLATION collation]]
    ...
    [DIFFERENCE FILE 'filepath']

 size  ::=  4096 | 8192 | 16384
  • If the user supplies a size smaller than 4096, it will be silently converted to 4096. Other numbers not equal to any of the supported sizes will be silently converted to the next lower supported size.

16 Kb page size supported

Changed in: 1.0, 2.1

Description

The maximum database page size has been raised from 8192 to 16384 bytes. In Firebird 2.1 and up, page sizes 1024 and 2048 are deprecated as inefficient. Firebird will no longer create databases with these page sizes, but it will connect to existing small-page databases without any problem.

Default collation for the database

Added in: 2.5

Description

In Firebird 2.5 and up, you can specify a collation with the default character set, as shown in the Syntax block above. If present, this collation will become the default collation for the default character set (and hence for the entire database, except where another character set is used).

Example

 create database "colltest.fdb" default character set iso8859_1 collation du_nl

Please notice: The keyword to use here is COLLATION, not the usual COLLATE.

DIFFERENCE FILE parameter

Added in: 2.0

Description

The DIFFERENCE FILE parameter was added in Firebird 2.0, but not documented at the time. For a full description, see ALTER DATABASE / ADD DIFFERENCE FILE.

See also:
Create Database
CREATE statement
ALTER DATABASE
DROP DATABASE
Page size
DDL - Data Definition Language
Creating your first database

back to top of page
<< COMMENT | FB 2.5 Language Reference | ALTER DATABASE >>