There are a number of programs in the contrib/ directory. If you are going to run this
installation as a server and wish to build some of them, enter
make -C contrib or
make -C contrib/<SUBDIR-NAME>
for each subdirectory.

Tests must be run as an unprivileged user because they need to
start a temporary server and this is prevented as the root user.
For the same reason, you need to stop all PostgreSQL servers if any
are running. If a previous version of PostgreSQL is installed, it
may be necessary to use --disable-rpath with configure to avoid failures, but
installing the binaries created using
this switch is not recommended. To test the results,
issue: make check.

Now, as the root user:

make install &&
make install-docs

If you made any of the contrib/
programs, as the root user:

make -C contrib/<SUBDIR-NAME> install

If you only intend to use PostgreSQL as a client to connect to a server
on another machine, your installation is complete and you should
not run the remaining commands.

Initialize a database cluster with the following commands issued by
the root user:

Configuring PostgreSQL

Config
Files

$PGDATA/pg_ident.con, $PGDATA/pg_hba.conf and $PGDATA/postgresql.conf

The PGDATA environment variable is
used to distinguish database clusters from one another by setting
it to the value of the directory which contains the cluster
desired. The three configuration files exist in every
PGDATA/ directory. Details on the
format of the files and the options that can be set in each can
be found in file:///usr/share/doc/postgresql-10.2/html/index.html.

Starting the PostgreSQL Server and Creating a Sample Database

Note

If you are scripting this part, you should wait for the server
to start before going on, by adding for example sleep 2 after the above
command.

The instructions below show how to create a database, add a table
to it, insert some rows into the table and select them, to verify
that the installation is working properly. Still as user
root, issue: