In the object hierarchy under every cluster are Databases. You can create, alter variables, comment on, and drop a database. In this example, you will create a database named web_store.
A database is an object under a cluster, so to create a database, first expand the cluster under which you wish to create the database (click the [O-] beside the cluster name).
Right-click on Databases and select CREATE DATABASE.
The first field is the name for the database. Type: web_store
Optionally, set the Owner. The default owner is the user creating the database; however, you can select any existing user by clicking on the drop-down list.
Optionally, set the Location. The default location is that specified by the environment variable PGDATA, but you can specify another previously initialized location.
The standard installation does not allow absolute paths to be used as locations, only environment variables known to the database backend. You must recompile the backend to allow the use of absolute paths.
Optionally, set the Template. The default template used is template1; however, you can specify any other existing database in the cluster to be used as the template for the new database.
Optionally, set the Encoding. The default encoding is SQL_ASCII; however, you can view the available encodings by clicking on the drop-down list.
Click OK to create the database.
Note that the database web_store has been added under the Database node in the Tree View.
Administrator also enables you to perform the following operations on an existing database:
To alter a variable for a database and set it as the session default, right-click on it and select ALTER DATABASE =>Set Variable. A dialog box asks for the values that need to be set/reset. The SET field takes the arguments that would be passed to SET in the ALTER DATABASE command. Similar, RESET takes the arguments that would be passed to RESET in the ALTER DATABASE command. RESET ALL restores all changeable variables to the default values.
PostgreSQL allows commenting on databases, which makes them easier to identify. To comment on a database, right-click on it and select COMMENT. A dialog asks for the comment. If there is already a comment on the database, this comment is displayed. Type the new comment in the edit box and click OK to save the new comment.
To drop a database, right-click on it and select DROP DATABASE. If Preferences => Ask For Confirmations is enabled, you are asked to confirm that you want the database dropped; if it is disabled, the database is dropped immediately. This action cannot be undone.
Refer to the PostgreSQL 7.3 Administrator's Guide for more information on database locations, templates, and encodings.