Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add contrib #4

Merged
merged 5 commits into from
Dec 28, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions src/postgresql/tests/test_postgresql.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,18 @@ def test_setup_teardown():
def test_fixture(tmp_postgres):
pgdata, con_str = tmp_postgres
postgresql.psql(f'-d "{con_str}" -c "select version()"')


def test_default_extension(tmp_postgres):
pgdata, con_str = tmp_postgres
postgresql.psql(f'-d "{con_str}" -c "CREATE EXTENSION hstore;"')


def test_uuid_ossp_extension(tmp_postgres):
pgdata, con_str = tmp_postgres
postgresql.psql(f'-d "{con_str}" -c \'CREATE EXTENSION "uuid-ossp";\'')


def test_xml2_extension(tmp_postgres):
pgdata, con_str = tmp_postgres
postgresql.psql(f'-d "{con_str}" -c "CREATE EXTENSION xml2;"')
11 changes: 7 additions & 4 deletions src/tools/install_pg.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,16 @@ else
VERSION=13.4
fi

yum install -y zlib-devel readline-devel
export DEBIAN_FRONTEND=noninteractive

sudo apt update
sudo apt install -y zlib1g-dev libreadline-dev libossp-uuid-dev libxml2-dev libxslt1-dev curl make gcc
curl -L -O https://ftp.postgresql.org/pub/source/v${VERSION}/postgresql-${VERSION}.tar.gz

tar -xzf postgresql-${VERSION}.tar.gz
cd postgresql-${VERSION}
./configure --prefix=`pwd`/../src/postgresql
make -j 4
make install
./configure --prefix=`pwd`/../src/postgresql --with-ossp-uuid --with-libxml --with-libxslt
make -j 4 world-bin
make install-world-bin
cd ..

20 changes: 20 additions & 0 deletions src/tools/install_pg_rpm.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
if [[ $1 =~ refs/tags/([0-9]+\.[0-9]+).*$ ]];
then
VERSION=${BASH_REMATCH[1]}
echo "Building ${VERSION}"
else
VERSION=13.4
fi

yum install -y dnf-plugins-core epel-release
yum config-manager --set-enabled powertools
yum install -y zlib-devel readline-devel uuid-devel libxml2-devel libxslt-devel
curl -L -O https://ftp.postgresql.org/pub/source/v${VERSION}/postgresql-${VERSION}.tar.gz

tar -xzf postgresql-${VERSION}.tar.gz
cd postgresql-${VERSION}
./configure --prefix=`pwd`/../src/postgresql --with-ossp-uuid --with-libxml --with-libxslt
make -j 4 world-bin
make install-world-bin
cd ..