The CREATE DATABASE statement creates a new database. Any user logged in to a database can issue the statement. (The user must also have permissions at the operating system to create files in the specified location.)
The CREATE DATABASE statement cannot be used to create the first database on a server. The reason is that a user must log on to a database before issuing the CREATE DATABASE statement. Therefore, at least one database must already exist.
Database-name specifies a name for the new database. The database names must be unique within a server and conform to the rules for identifiers. See
Identifier Restrictions by Identifier Type in
Advanced Operations Guide.
Dict-path-name specifies where the dictionary files (DDFs) reside on physical storage. The data files are also placed in this same location when you use the
CREATE TABLE statement or create tables using Pervasive PSQL Control Center (PCC). See
Dictionary Location in
Pervasive PSQL User's Guide.
Data-path-name specifies a possible location of the data files for the database (see
Note below). You can specify multiple path names by delimiting them with a semicolon.
Data-path-name can be any path that is valid from the database engine's point of view, not from the calling application's perspective. The location specified must already exist. The CREATE DATABASE statement does not create directories.
Omit data-path-name if you want to use the same location for the data files as for the dictionary files. You may also specify the same location by passing an empty string for
data-path-name. For example, specifying
DATA_PATH '' indicates an empty string for the data path.
Note: If you create tables using the CREATE TABLE statement or with PCC, the data files are placed in the first
dict-path-name specified. If no
dict-path-names are specified, data files are created in the
dict-path-name location.
Data-path-name is useful if you are creating tables through the Distributed Tuning Interface (DTI). The DTI function PvAddTable allows you to specify where you want the data files located. See
PvAddTable() in the Developer Reference book
Distributed Tuning Interface Guide.
If REUSE_DDF is omitted, new DDFs are created unless DDFs already exists in the
dict-path-name location. If DDFs exists in the
dict-path-name location, they are associated with the database instead of new DDFs being created.
See the chapter Pervasive PSQL Security in
Advanced Operations Guide for a complete discussion of security.
Note: The database engine does not validate the encoding of the data and metadata that an application inserts into a database. The engine assumes that all data was entered using the encoding of the server or the client, as explained in
Encoding Interaction in
Getting Started With Pervasive PSQL.
For SQL statements that involve the use of more than one database (such as a multi-database join), ensure that the database code page is the same for all of the databases. Otherwise, string data can be returned incorrectly.
You can view the list of supported code page names and numbers with PCC. Start PCC and access the New Database dialog (see To create a new database in
Pervasive PSQL User's Guide). For the “Database Code Page” option, click
Change code page. On the dialog that displays, click
Database code page to see a list of available code pages.