Install PostgreSQL 16beta1 and AGE, along with possible error Solution's
Tags: postgressql, linux, database, bitnine
Published: 2023-06-26 19:14:25

## Introduction
Apache AGE, which is an extension of PostgreSQL. It's a graphical representation of relational database. Currently it(AGE) supports PostgreSQL version 12 and 13. We are also working on its capability to support PG15 and 16. In this, we will be installing it for PostgreSQL 16beta1 and on linux operating system.

## Create Directories

```
mkdir age16
cd age16
mkdir pg
cd pg

```

## Install required Dependencies

```
sudo apt-get install build-essential libreadline-dev zlib1g-dev flex bison

```

After installing required dependencies. Now we will first install PostgreSQL 16beta1 and then AGE.

## PostgreSQL 

```
wget https://ftp.postgresql.org/pub/source/v16beta1/postgresql-16beta1.tar.gz && tar -xvf postgresql-16beta1.tar.gz && rm -f postgresql-16beta1.tar.gz

```
This command will download and extract postgresql 16beta1.

If it successful it will be shown like this.

![https://dev-to-uploads.s3.amazonaws.com/uploads/articles/y43hxs02qdqbmj0yp1bq.png](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/y43hxs02qdqbmj0yp1bq.png)

We have downloaded and extracted it successfully. Now move inside beta16 directory and install postgresql.

```
cd postgresql-16beta1
# configure by setting flags
./configure --enable-debug --enable-cassert --prefix=$(pwd) CFLAGS="-ggdb -Og -fno-omit-frame-pointer"

#install 
make install

```
There could be an error of this type.

```
ERROR: `bison' is missing on your system. It is needed to create the
file `src/backend/parser/cypher_gram.c'. You can either get bison from a GNU mirror site
```
To resolve this error you can visit this [link](https://stackoverflow.com/questions/76477533/installing-age-pg16-beside-postgresql-v16beta1-giving-bison-is-missing-while-it).



Installing it will take a bit of time. After successful installation it will show a windows like this.


![PostgreSQL installed](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7gu7nw2k9p2nhsrjzrxn.png) 

Now go back to main directory, 

```
cd ../
cd ../
```
## AGE
Clone and install AGE from sources latest repository.

```
git clone https://github.com/panosfol/age
```

This will clone and create a repo `age`. Go to age directory.

```
cd age
```

Now checkout to latest branch and install age from that.

```
git checkout PG16
```
#install

```
make PG_CONFIG=/home/username/age16/pg/postgresql-16beta1/bin/pg_config install
```

To check username, run `whoami` and replace it in the above command. 

Now you can check if its successfully installed or not.

```
make PG_CONFIG=/home/username/age16/pg/postgresql-16beta1/bin/pg_config installcheck

```
Currently its showing 19/24 test cases failed.

![Install Check](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jd0q81ua6af6uafeie24.png)

You have successfully installed it now can work on it and contribute to this.


## References

### 1. [https://github.com/panosfol/age/tree/PG16](https://github.com/panosfol/age/tree/PG16)
### 2. [https://ftp.postgresql.org/pub/source/v16beta1/](https://ftp.postgresql.org/pub/source/v16beta1/)