This guide aims to assist you in installing PostgreSQL and seamlessly integrating it with Apache AGE on your Windows system. It is designed to provide a step-by-step walkthrough, ensuring a straightforward installation process. While there is an informative YouTube video available, I personally encountered some minor difficulties while following it. Hence, this guide aims to simplify the process further.
Let me provide you with the information upfront: Apache AGE does not currently support Windows, so we will need to use Linux instead. Additionally, to install WSL2, you will need a minimum of
- Windows 10 May 2020 (2004), Windows 10 May 2019 (1903), or Windows 10 November 2019 (1909) versions.
- Your computer must also have Hyper-V Virtualization support.
You can check your Windows version by searching for "winver" in the search bar.
It is highly unlikely that anyone reading this guide would not meet the mentioned requirements. However, if you happen to not meet the requirements, you can still follow another guide that demonstrates the installation using WSL1.
There are various methods available to install the mentioned software. However, in my case, I chose to directly use WSL2 in Windows without installing Docker or setting up a dual-boot system with Linux.
Install WSL2
Assumption: You have installed newer versions of Windows, for further procedure,
For WSL2, run cmd as administrator and type wsl.exe --install
, as shown below
After this wait for few minutes, until linux have completely installed.
Note: Restart the System
After restart, automatically linux will start and setup unix in that terminal, further it will prompt to enter username and password.
Hurrah! WSL2 has been successfully installed in your system.
A very Important step before Installing Postgres-SQL
Before moving forward, make sure to download the required dependencies by running the command sudo apt-get install build-essential libreadline-dev zlib1g-dev flex bison
Failing to do so may require you to repeat the process and reinstall PostgreSQL again.
Install Postgres-SQL
As per the documentation, versions 11, 12, and 13 of PostgreSQL are supported and can be installed on Ubuntu using the command sudo apt install postgresql-11 postgresql-server-dev-11
for version 11, for example. However, I encountered difficulties when attempting this method, so I had to resort to manually downloading the source code and installing it. To do this, you can download the source code from the PostgreSQL, and I recommend getting version 11.18. Make sure to download the tar.gz file.
Next, you will need to navigate to the location of the tar.gz file in your Linux terminal and copy it to your Linux environment's home directory. In my case, I downloaded the tar.gz file to the "Downloads" folder. Therefore, I recommend to follow below steps:
Step:1
Step:2
Step:3
Step:4
Now, navigate back to the home directory, type cd
in the terminal. Once there, you can unzip the tar file using the command
tar -xzf postgresql-11.18.tar.gz
Step:5
Navigate inside the unzipped folder and run the command ./configure --prefix=$(pwd) --enable-cassert --enable-debug CFLAGS="-ggdb -Og -g3 -fno-omit-frame-pointer"
. After this, you will see a makefile in your folder, now run the command make install
to install.
Hurrah! Postgres-SQL has been successfully installed in your system.
Verification Step:
You can verify it by navigating to the bin folder inside your PostgreSQL installation and typing the command ./psql --version
.
Install Apache-AGE
Now, clone the Apache AGE repository into the home directory. Therefore, I recommend to follow below steps:
Step:1
git clone https://github.com/apache/age.git
Step:2
Now, cd
into the cloned folder and run the command sudo make PG_CONFIG=~/postgresql-11.18/bin/pg_config install
.
Note: The argument to PG_CONFIG here, is the location of the pg_config file of your PostgreSQL installation. Since, I unzipped the PostgreSQL source code directly into the home folder.
Hurrah! Apache-AGE has been successfully installed in your system.
Hurrah! Postgre-SQL and Apache-AGE has been successfully installed in your system. Start studying more about postgresql
I hope, this blog has helped you for successful installation.
For further installation, see Part-2.
Top comments (0)