From 6945616e713be01cc779e14c78ad0f8e8a69876b Mon Sep 17 00:00:00 2001 From: Samay Sharma Date: Fri, 24 Feb 2023 20:41:28 -0800 Subject: [PATCH v9 5/5] Change Short Version for meson installation guide This commit proposes a new version of the short version for building from source using meson. Some advantages over the current version include: does not require sudo, creates a localised installation path and doesn't replace system binaries, doesn't have distro specific commands and has one line description of what each command does. --- doc/src/sgml/installation.sgml | 40 +++++++++++++++++++++++++--------- 1 file changed, 30 insertions(+), 10 deletions(-) diff --git a/doc/src/sgml/installation.sgml b/doc/src/sgml/installation.sgml index 0efbb1c2a3..d1791e5952 100644 --- a/doc/src/sgml/installation.sgml +++ b/doc/src/sgml/installation.sgml @@ -1967,19 +1967,39 @@ build-postgresql: -meson setup build --prefix=/usr/local/pgsql +# create working directory +mkdir postgres +cd postgres + +# fetch source code +git clone https://git.postgresql.org/git/postgresql.git src + +# setup and enter build directory (done only first time) +## Unix based platforms +meson setup build src --prefix=$PWD/install + +## Windows +meson setup build src --prefix=%cd%/install + cd build + +# Compile source ninja -su + +# Install to the prefix directory specified above ninja install -adduser postgres -mkdir -p /usr/local/pgsql/data -chown postgres /usr/local/pgsql/data -su - postgres -/usr/local/pgsql/bin/initdb -D /usr/local/pgsql/data -/usr/local/pgsql/bin/pg_ctl -D /usr/local/pgsql/data -l logfile start -/usr/local/pgsql/bin/createdb test -/usr/local/pgsql/bin/psql test + +# Run all tests (optional, takes time) +meson test + +# Initialize a new database +../install/bin/initdb -D ../data + +# Start database +../install/bin/pg_ctl -D ../data/ -l logfile start + +# Connect to the database +../install/bin/psql -d postgres The long version is the rest of this section. -- 2.38.1