From 7b1746d8ee6539645187dd3441d46c14d01cffc1 Mon Sep 17 00:00:00 2001 From: Artur Zakirov Date: Tue, 28 Nov 2023 15:48:02 +0100 Subject: [PATCH 1/6] Issue #338: Removed old EOL PostgreSQL versions --- doc/pg_repack.rst | 2 +- doc/pg_repack_jp.rst | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/pg_repack.rst b/doc/pg_repack.rst index 5da8e2f..5624f7f 100644 --- a/doc/pg_repack.rst +++ b/doc/pg_repack.rst @@ -40,7 +40,7 @@ Requirements ------------ PostgreSQL versions - PostgreSQL 9.4, 9.5, 9.6, 10, 11, 12, 13, 14, 15, 16 + PostgreSQL 10, 11, 12, 13, 14, 15, 16 Disks Performing a full-table repack requires free disk space about twice as diff --git a/doc/pg_repack_jp.rst b/doc/pg_repack_jp.rst index 28ff49f..581a3c1 100644 --- a/doc/pg_repack_jp.rst +++ b/doc/pg_repack_jp.rst @@ -62,7 +62,7 @@ pg_repackでは再編成する方法として次のものが選択できます ------------ PostgreSQL versions - PostgreSQL 9.4, 9.5, 9.6, 10, 11, 12, 13, 14, 15, 16 + PostgreSQL 10, 11, 12, 13, 14, 15, 16 Disks Performing a full-table repack requires free disk space about twice as @@ -75,7 +75,7 @@ pg_repackでは再編成する方法として次のものが選択できます --------- PostgreSQL バージョン - PostgreSQL 9.4, 9.5, 9.6, 10, 11, 12, 13, 14, 15, 16 + PostgreSQL 10, 11, 12, 13, 14, 15, 16 ディスク テーブル全体の再編成を行うには、対象となるテーブルと付属するインデックスのおよそ2倍のサイズのディスク空き容量が必要です。例えば、テーブルとインデックスを合わせたサイズが1GBの場合、2GBのディスク領域が必要となります。 From d239c3f28e8714e4379b00fc239e00d2510fc5e4 Mon Sep 17 00:00:00 2001 From: Artur Zakirov Date: Tue, 28 Nov 2023 16:33:20 +0100 Subject: [PATCH 2/6] Add old PostgreSQL version to tests and delete travis leftovers --- .github/workflows/regression.yml | 3 ++ regress/travis_prepare.sh | 69 -------------------------------- regress/travis_test.sh | 10 ----- 3 files changed, 3 insertions(+), 79 deletions(-) delete mode 100755 regress/travis_prepare.sh delete mode 100755 regress/travis_test.sh diff --git a/.github/workflows/regression.yml b/.github/workflows/regression.yml index 812c5a1..0b137d0 100644 --- a/.github/workflows/regression.yml +++ b/.github/workflows/regression.yml @@ -14,6 +14,9 @@ jobs: - 12 - 11 - 10 + - 9.6 + - 9.5 + - 9.4 name: PostgreSQL ${{ matrix.pg }} runs-on: ubuntu-latest diff --git a/regress/travis_prepare.sh b/regress/travis_prepare.sh deleted file mode 100755 index cee73cc..0000000 --- a/regress/travis_prepare.sh +++ /dev/null @@ -1,69 +0,0 @@ -#!/bin/bash - -set -e -x - -export PACKAGE="$PGVER" -export PGDIR="/usr/lib/postgresql/$PACKAGE" -export CONFDIR="/etc/postgresql/$PACKAGE/main" -export DATADIR="/var/lib/postgresql/$PACKAGE/main" -export PGBIN="$PGDIR/bin" -export PATH="$PGBIN:$PATH" - -# This also stops the server currently running on port 5432 -sudo apt-get remove -y libpq5 - -# Match libpq and server-dev packages -# See https://github.com/reorg/pg_repack/issues/63 -sudo sh -c 'echo "deb [arch=amd64] http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main ${PGVER}" > /etc/apt/sources.list.d/pgdg.list' - -# Import the repository signing key: -wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add - - -sudo apt-get update - -# This might be a moving target, but it currently fails. 13 could start -# failing in the future instead. -# Some versions break if this is not specified (9.4 for sure, maybe 9.6) -if [[ "$PGVER" = "9.4" ]]; then - sudo apt-get install -y "libpq5=${PGVER}*" "libpq-dev=${PGVER}*" - sudo apt-mark hold libpq5 -fi - -# missing build dependency by postgresql-server-dev -if [[ "$PGVER" -ge "14" ]]; then - sudo apt-get install -y liblz4-dev -fi - -if ! sudo apt-get install -y \ - postgresql-$PGVER \ - postgresql-client-$PGVER \ - postgresql-server-dev-$PGVER -then - sudo systemctl status postgresql.service -l - exit 1 -fi - -# ensure PostgreSQL is running on 5432 port with proper auth -sudo sed -i \ - 's/\(^local[[:space:]]\+all[[:space:]]\+all[[:space:]]\+\).*/\1trust/' \ - "$CONFDIR/pg_hba.conf" -sudo bash -c "echo 'port=5432' >> $CONFDIR/postgresql.conf" -sudo service postgresql restart $PGVER - -# ensure travis user exists. May be missed if the database was not provided by Travis -userexists=`sudo -u postgres "$PGBIN/psql" -tc "select count(*) from pg_catalog.pg_user where usename='travis';"` -if [ ${userexists} -eq 0 ]; then - sudo -u postgres "$PGBIN/psql" -c "create user travis superuser" -fi - -# Go somewhere else or sudo will fail -cd / - -# Already started because of installing posgresql-$PGVER -# sudo -u postgres "$PGBIN/pg_ctl" -w -l /dev/null -D "$CONFDIR" start -sudo -u postgres mkdir -p /var/lib/postgresql/testts -sudo -u postgres "$PGBIN/psql" \ - -c "create tablespace testts location '/var/lib/postgresql/testts'" - -# Go back to the build dir -cd - diff --git a/regress/travis_test.sh b/regress/travis_test.sh deleted file mode 100755 index 763a705..0000000 --- a/regress/travis_test.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/bash - -set -x - -export PG_REGRESS_DIFF_OPTS=-u - -if ! make installcheck; then - cat regress/regression.diffs - exit 1 -fi From ede9bc3e8e76b8e801ecd11612b6e79f0b290f6b Mon Sep 17 00:00:00 2001 From: Artur Zakirov Date: Tue, 28 Nov 2023 16:43:34 +0100 Subject: [PATCH 3/6] Explicitly set `create_table` type --- lib/pg_repack.sql.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/pg_repack.sql.in b/lib/pg_repack.sql.in index cca6d13..f52d0cf 100644 --- a/lib/pg_repack.sql.in +++ b/lib/pg_repack.sql.in @@ -277,7 +277,7 @@ CREATE VIEW repack.tables AS 'SELECT repack.create_log_table(' || R.oid || ')' AS create_log, repack.get_create_trigger(R.oid, PK.indexrelid) AS create_trigger, repack.get_enable_trigger(R.oid) as enable_trigger, - 'SELECT repack.create_table($1, $2)' AS create_table, + 'SELECT repack.create_table($1, $2)'::text AS create_table, coalesce(S.spcname, S2.spcname) AS tablespace_orig, 'INSERT INTO repack.table_' || R.oid || ' SELECT ' || repack.get_columns_for_create_as(R.oid) || ' FROM ONLY ' || repack.oid2text(R.oid) AS copy_data, repack.get_alter_col_storage(R.oid) AS alter_col_storage, From 52d1088e608571bc32a9b4262021f3eddae4df36 Mon Sep 17 00:00:00 2001 From: Artur Zakirov Date: Tue, 28 Nov 2023 16:50:28 +0100 Subject: [PATCH 4/6] Add Postgres 9.6, 9.5 to the documentation --- .github/workflows/regression.yml | 1 - doc/pg_repack.rst | 2 +- doc/pg_repack_jp.rst | 4 ++-- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/regression.yml b/.github/workflows/regression.yml index 0b137d0..003ae00 100644 --- a/.github/workflows/regression.yml +++ b/.github/workflows/regression.yml @@ -16,7 +16,6 @@ jobs: - 10 - 9.6 - 9.5 - - 9.4 name: PostgreSQL ${{ matrix.pg }} runs-on: ubuntu-latest diff --git a/doc/pg_repack.rst b/doc/pg_repack.rst index 5624f7f..d3a14ed 100644 --- a/doc/pg_repack.rst +++ b/doc/pg_repack.rst @@ -40,7 +40,7 @@ Requirements ------------ PostgreSQL versions - PostgreSQL 10, 11, 12, 13, 14, 15, 16 + PostgreSQL 9.5, 9.6, 10, 11, 12, 13, 14, 15, 16 Disks Performing a full-table repack requires free disk space about twice as diff --git a/doc/pg_repack_jp.rst b/doc/pg_repack_jp.rst index 581a3c1..edf80eb 100644 --- a/doc/pg_repack_jp.rst +++ b/doc/pg_repack_jp.rst @@ -62,7 +62,7 @@ pg_repackでは再編成する方法として次のものが選択できます ------------ PostgreSQL versions - PostgreSQL 10, 11, 12, 13, 14, 15, 16 + PostgreSQL 9.5, 9.6, 10, 11, 12, 13, 14, 15, 16 Disks Performing a full-table repack requires free disk space about twice as @@ -75,7 +75,7 @@ pg_repackでは再編成する方法として次のものが選択できます --------- PostgreSQL バージョン - PostgreSQL 10, 11, 12, 13, 14, 15, 16 + PostgreSQL 9.5, 9.6, 10, 11, 12, 13, 14, 15, 16 ディスク テーブル全体の再編成を行うには、対象となるテーブルと付属するインデックスのおよそ2倍のサイズのディスク空き容量が必要です。例えば、テーブルとインデックスを合わせたサイズが1GBの場合、2GBのディスク領域が必要となります。 From fd74e8d460d65d6b91612ad388e3279faf502d4b Mon Sep 17 00:00:00 2001 From: Artur Zakirov Date: Tue, 28 Nov 2023 17:09:05 +0100 Subject: [PATCH 5/6] Mention in the docs that Postgres 9.4 and below are not supported --- doc/pg_repack.rst | 4 +++- doc/pg_repack_jp.rst | 6 ++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/doc/pg_repack.rst b/doc/pg_repack.rst index d3a14ed..f4b1ab9 100644 --- a/doc/pg_repack.rst +++ b/doc/pg_repack.rst @@ -40,7 +40,9 @@ Requirements ------------ PostgreSQL versions - PostgreSQL 9.5, 9.6, 10, 11, 12, 13, 14, 15, 16 + PostgreSQL 9.5, 9.6, 10, 11, 12, 13, 14, 15, 16. + + PostgreSQL 9.4 and before it are not supported. Disks Performing a full-table repack requires free disk space about twice as diff --git a/doc/pg_repack_jp.rst b/doc/pg_repack_jp.rst index edf80eb..b409951 100644 --- a/doc/pg_repack_jp.rst +++ b/doc/pg_repack_jp.rst @@ -62,8 +62,10 @@ pg_repackでは再編成する方法として次のものが選択できます ------------ PostgreSQL versions - PostgreSQL 9.5, 9.6, 10, 11, 12, 13, 14, 15, 16 - + PostgreSQL 9.5, 9.6, 10, 11, 12, 13, 14, 15, 16. + + PostgreSQL 9.4 and before it are not supported. + Disks Performing a full-table repack requires free disk space about twice as large as the target table(s) and its indexes. For example, if the total From bbf95da5f9e879ad39d410d50e6c016f7819cf82 Mon Sep 17 00:00:00 2001 From: Artur Zakirov Date: Tue, 28 Nov 2023 17:10:39 +0100 Subject: [PATCH 6/6] Return whitespaces into the .rst file --- doc/pg_repack_jp.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/pg_repack_jp.rst b/doc/pg_repack_jp.rst index b409951..4c34eb6 100644 --- a/doc/pg_repack_jp.rst +++ b/doc/pg_repack_jp.rst @@ -63,9 +63,9 @@ pg_repackでは再編成する方法として次のものが選択できます PostgreSQL versions PostgreSQL 9.5, 9.6, 10, 11, 12, 13, 14, 15, 16. - + PostgreSQL 9.4 and before it are not supported. - + Disks Performing a full-table repack requires free disk space about twice as large as the target table(s) and its indexes. For example, if the total