CREATDB(1)

NAME
creatdb - create an INGRES database

SYNOPSIS
creatdb [-u name] [-e] [-m] [-+-c] [-+-q] dbname

DESCRIPTION
The creatdb utility creates a new INGRES database, or modifies the status of an existing database. The person who executes this command becomes the Database Administrator (DBA) for the database. The DBA has special powers not granted to ordinary users.

dbname is the name of the database to be created. The name must be unique among all INGRES users.

The options are as follows:

-+-c
    Turn concurrency control on or off. The form +c turns it on, -c turns it off. Concurrency control defaults to on.

    Concurrency control should not be turned off except on databases which are never accessed by more than one user. This applies even if users do not share data relations, since system relations are still shared. If the concurrency control scheme is not installed, or if the special file /dev/lock does not exist or is not accessible for read-write by INGRES, concurrency control acts as though it is off.

-+-q
    Turn query modification on or off. The form +q turns it on, -q turns it off. Query modification defaults to on.

    Query modification must be turned on for the protection, integrity, and view subsystems to work; however, the system will run slightly slower in some cases if it is turned on. It is possible to turn query modification on if it is already off in an existing database, but it is not possible to turn it off if it is already on.

    Databases with query modification turned off create new relations with all access permitted for all users, instead of no access except to the owner (the default when query modification is enabled).

-e  Modify database options for an existing database. The database is adjusted to conform to the option flags. Only the DBA may use this flag. When query modification is turned on, new relations will be created with no access, but previously created relations will still have all access to everyone.

-m  Specify that the directory in which the database is to reside already exists. This should only be needed if the directory is a mounted file system, as might occur for a very large database. The directory must exist, must be mode 777, and must be empty of all files.

-u name
    Specify a different DBA. The flag should be immediately followed by the login name of the user who should be the DBA. Only the INGRES superuser may use this flag.

The INGRES superuser can create a file in the database directory containing a single line which is the full pathname of the location of the database. When the database is created, it will be created in the file named, rather than in the default directory.

The user who executes this command must have the U_CREATDB bit set in the status field of their entry in the users file.

EXAMPLES
    creatdb demo
    creatdb -ueric -q erics_db
    creatdb -e +q -c -u:av erics_db

FILES

.../files/dbtmplt7
    Database template.

.../data/base/*
    Database storage directory.

DIAGNOSTICS

database name specified.
    A database name was not provided on the command line.

You are not a valid INGRES user.
    No entry exists in the users file for the current user.

You are not allowed this command.
    The U_CREATDB bit is not set in the users file entry.

You may not use the -u flag.
    Only the INGRES superuser may become someone else.

name already exists.
    Without -e or -m, the database directory already exists.

name does not exist.
    With -e or -m, the directory does not exist.

name is not empty.
    With the -m flag, the directory must be empty.

You are not the DBA for this database.
    With the -e flag, only the DBA may modify database options.

SEE ALSO
destroydb(1), ingres(1), usersetup(1)

HISTORY
Originally part of UC Berkeley INGRES 8.9 (1988).