diff --git a/src/postgresql/tests/test_postgresql.py b/src/postgresql/tests/test_postgresql.py index b19e13e..24f9f5f 100644 --- a/src/postgresql/tests/test_postgresql.py +++ b/src/postgresql/tests/test_postgresql.py @@ -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;"') diff --git a/src/tools/install_pg.sh b/src/tools/install_pg.sh old mode 100644 new mode 100755 index 5bc459d..32f287b --- a/src/tools/install_pg.sh +++ b/src/tools/install_pg.sh @@ -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 .. diff --git a/src/tools/install_pg_rpm.sh b/src/tools/install_pg_rpm.sh new file mode 100644 index 0000000..797bddd --- /dev/null +++ b/src/tools/install_pg_rpm.sh @@ -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 .. +