resuper.blogg.se

Create my own cataloge for mac
Create my own cataloge for mac












create my own cataloge for mac create my own cataloge for mac

So the process might look like this: root# mkdir /usr/local/pgsql If the desired parent directory doesn't exist either, you will need to create it first, using root privileges if the grandparent directory isn't writable. It's generally recommendable that the PostgreSQL user own not just the data directory but its parent directory as well, so that this should not be a problem. Of course, this will fail if initdb does not have permissions to write in the parent directory. Initdb will attempt to create the directory you specify if it does not already exist. This may be more intuitive if you are using pg_ctl for starting and stopping the server (see Section 17.3), so that pg_ctl would be the sole command you use for managing the database server instance. Tip: As an alternative to the -D option, you can set the environment variable PGDATA.Īlternatively, you can run initdb via the pg_ctl program like so: $ pg_ctl -D /usr/local/pgsql/data initdb Note that you must execute this command while logged into the PostgreSQL user account, which is described in the previous section. The desired file system location of your database cluster is indicated by the -D option, for example: $ initdb -D /usr/local/pgsql/data To initialize a database cluster, use the command initdb, which is installed with PostgreSQL. There is no default, although locations such as /usr/local/pgsql/data or /var/lib/pgsql/data are popular. It is completely up to you where you choose to store your data. We call this the data directory or data area. In file system terms, a database cluster is a single directory under which all data will be stored. (See Chapter 21 for information about creating new databases within a cluster.) As the name suggests, this will be used as a template for subsequently created databases it should not be used for actual work. Another database created within each cluster during initialization is called template1. The database server itself does not require the postgres database to exist, but many external utility programs assume it exists. After initialization, a database cluster will contain a database named postgres, which is meant as a default database for use by utilities, users and third party applications. (The SQL standard uses the term catalog cluster.) A database cluster is a collection of databases that is managed by a single instance of a running database server.

create my own cataloge for mac

Before you can do anything, you must initialize a database storage area on disk.














Create my own cataloge for mac