Open turgs opened 6 years ago
Here are the exact steps I run on Ubuntu 16.04 as a bash file to install and configure postgres, and install the extension:
# INSTALL POSTGRES 10
sudo add-apt-repository "deb http://apt.postgresql.org/pub/repos/apt/ xenial-pgdg main"
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
sudo apt-get -y update
sudo apt-get -y install postgresql-10 postgresql-contrib-10 postgresql-server-dev-10 gcc
sudo /etc/init.d/postgresql restart
# install sql_firewall
mkdir /home/deploy/sql_firewall
cd /home/deploy/sql_firewall
curl -sL https://github.com/turgs/sql_firewall/archive/develop.tar.gz | tar xz
cd sql_firewall-*
sudo sh ./build.sh ##### this line currently fails due to compilation errors
sudo sh ./build.sh install
cd
rm -rf /home/deploy/sql_firewall
sudo /etc/init.d/postgresql restart
# create my database and user
sudo -u postgres psql --command "CREATE USER myUser1 WITH PASSWORD 'password';"
sudo -u postgres psql --command 'CREATE DATABASE MyDatabase;'
sudo -u postgres psql --command 'GRANT ALL PRIVILEGES ON DATABASE MyDatabase to myUser1;'
# add extension
sudo -u postgres psql MyDatabase --command 'CREATE EXTENSION sql_firewall;'
sudo /etc/init.d/postgresql restart
On DigitalOcean, I have an Ubuntu 16.04 droplet, where Postgres is installed via apt-get.
This extension compiled and installed correctly on Postgres 9.6, however it's now failing with Postgres 10. Everything else is the same. I'm installing the same way, on Ubuntu 16.04. From a quick googling myself, it sounds like some API changes may have occurred in Postgres 10.
Compiling the extension via ‘sudo sh ./build.sh’ shows these errors: