Busy with the source code compiled and installed PostgreSQL, encountered a lot of trouble, record a bit.
1: An error occurred while using the./configure configuration. Look at the information that is missing the relevant package. What Readline,zlip and so on.
My configuration is simple, just configure the path:./configure--prefix=/home/zhangsan/postgresql
According to the error message, it is not what package I have. Install via new software.
Do not know right, the last configuration error, also compiled successfully.
2: To create a Linux User: Postgres and the default user for the database.
Shell>adduser Postgres
3: Create the data and log two directories in the PostgreSQL installation directory, respectively, and store the database and logs.
To make sure that the owner of the PostgreSQL directory and the following directory is Postgres, modify
Shell>sudo Chown postgres:postgres/home/zhangsan/postgresql/
4: Switch to Postgres user and initialize database
Use the POSTGRESQL/BIN/INITDB command. Specify the data directory and the log directory when you use it
shell>initdb-d/home/zhangsan/postgresql/data-x/home/zhangsan/postgresql/log
5: An error occurred while starting the database service with PG_CTL.
found no such person directory, nor that file.
But I looked at it with ls , and found a file with the same name in the TMP directory, using the LN command to make a soft link.
Ln-s/tmp/.s.pgsql.5432
Also cancel the # comment in data/postgresql.conf
Could not open this file, switch to root on the open.
Then in the log log directory to build a log file Pglog.log, the file name is random.
Then start with the command pg_ctl. Specify data directory and log file at startup
pg_ctl-d/.../data-x/.../log/pglog.log
With an absolute path.
Switch to Postgres user, start with psql.
Ubuntu Compilation Install PostgreSQL