-
Notifications
You must be signed in to change notification settings - Fork 1
Build PostgreSQL
David Li edited this page Apr 28, 2019
·
2 revisions
Reference:Installation from Source Code
Requisites:
- gcc
sudo apt install gcc g++
- make
sudo apt install make
- bison/flex
sudo apt install bison flex
- zlib
sudo apt install zlib1g-dev
- libedit-dev (BSD-license replacement of readline)
sudo apt install libedit-dev
Checkout PostgreSQL 11.2:
git clone https://github.com/davidli2010/postgresql-11.2.git
Build DEBUG:
cd postgresql-11.2
chmod +x ./configure
./configure --with-libedit-preferred --enable-debug --enable-cassert --enable-depend --prefix=</path/to/install> CFLAGS=-O0
make install -j 4
Create test database:
cd </path/to/install>/bin
./initdb -D ../data
./postgres -D ../data >logfile 2>&1 &
./createdb test
./psql test
See also https://www.cnblogs.com/baisha/p/7829028.html.
Reference:Building with Visual C++ or the Microsoft Windows SDK
Requisites:
- Visual Studio 2019 Community: https://visualstudio.microsoft.com/zh-hans/vs/
- ActivePerl: https://www.activestate.com/products/activeperl/downloads/
- diff: http://gnuwin32.sourceforge.net/packages/diffutils.htm/
- flex/bsion(included in msys): http://www.mingw.org/wiki/MSYS/
Checkout PostgreSQL 11.2:
git clone https://github.com/davidli2010/postgresql-11.2.git
MSVC build scripts is modified to suppport Visual Studio 2019 in commit a8eb92b5.
Use x64 Native Tools Command Prompt for VS 2019
command line to build.
Build DEBUG:
cd postgresql-11.2\src\tools\msvc
build DEBUG
vcregress check
install <\path\to\install>
Create test database:
cd <\path\to\install>
initdb -D ../data
pg_ctl -D ../data -l logfile start
createdb test
psql test