initdb
directory
-
-
+
- This option specifies the directory where the transaction log
- should be stored.
+ Makes initdb read the database superuser's password
+ from a file. The first line of the file is taken as the password.
-
-
+
+
- Makes initdb read the database superuser's password
- from a file. The first line of the file is taken as the password.
+ This option specifies the directory where the transaction log
+ should be stored.
+
Starting the Server
- To start up a server:
+ To start the server:
- An example of starting the server, and waiting until the server is
- accepting connection:
+ To start the server, waiting until the server is
+ accepting connections:
- For a server using port 5433, and
+ To start the server using port 5433, and
running without fsync, use:
$ pg_ctl -o "-F -p 5433" start
The option allows control over
- how the server shuts down.
+ how the server shuts down:
+
+
- To restart using port 5433 and disable fsync> upon restart:
+ To restart using port 5433, disabling fsync> upon restart:
$ pg_ctl -o "-F -p 5433" restart
The postgres command can also be called in
single-user mode. The primary use for this mode is during
bootstrapping by . Sometimes it is used
- for debugging or disaster recovery (but note that running a single-user
+ for debugging or disaster recovery; note that running a single-user
server is not truly suitable for debugging the server, since no
- realistic interprocess communication and locking will happen).
+ realistic interprocess communication and locking will happen.
When invoked in single-user
mode from the shell, the user can enter queries and the results
will be printed to the screen, but in a form that is more useful
- Ignore system indexes when reading system tables (but still update
- the indexes when modifying the tables). This is useful when
+ Ignore system indexes when reading system tables, but still update
+ the indexes when modifying the tables. This is useful when
recovering from damaged system indexes.
To start postgres with a specific
- port:
+ port, e.g. 1234:
- This command will start up postgres
- communicating through the port 1234. In order to connect to this
- server using
psql>, you would need to run it as
+ To connect to this server using
psql>, specify this port with the -p option: