Skip to content

Commit

Permalink
Drop 9.2 support
Browse files Browse the repository at this point in the history
Postgres 9.2 has been EOL since 2017-11-09.
  • Loading branch information
msakrejda committed Feb 19, 2021
1 parent 2a024c4 commit 10802d9
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 66 deletions.
2 changes: 1 addition & 1 deletion input/full.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ func CollectFull(server *state.Server, connection *sql.DB, globalCollectionOpts
}

if ts.Version.Numeric < state.MinRequiredPostgresVersion {
err = fmt.Errorf("Error: Your PostgreSQL server version (%s) is too old, 9.2 or newer is required.", ts.Version.Short)
err = fmt.Errorf("Error: Your PostgreSQL server version (%s) is too old, 9.3 or newer is required.", ts.Version.Short)
return
}

Expand Down
24 changes: 0 additions & 24 deletions integration_test/Dockerfile.test-pg92

This file was deleted.

27 changes: 2 additions & 25 deletions integration_test/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,32 +10,9 @@ DOCKER_RUN_CMD = docker run --name pganalyze-collector-test \
-d \
pganalyze-collector-test

.PHONY: pg92 pg93 pg94 pg95 pg96 pg10 pg11 pg12 pg13 guided-setup
.PHONY: pg93 pg94 pg95 pg96 pg10 pg11 pg12 pg13 guided-setup

all: pg92 pg93 pg94 pg95 pg96 pg10 pg11 pg12 pg13 guided-setup

pg92:
docker build -f Dockerfile.test-pg92 $(DOCKER_BUILD_OPTS)
$(DOCKER_RUN_CMD)
sleep 10
docker exec pganalyze-collector-test pgbench -U postgres -i
docker exec pganalyze-collector-test pgbench -U postgres
docker exec pganalyze-collector-test sh -c "DB_USERNAME=postgres PGA_API_KEY=dummy PGA_DISABLE_ACTIVITY=1 IGNORE_SCHEMA_REGEXP=pgbench_history pganalyze-collector --dry-run --force-state-update -v" > pg92_1.json
docker exec pganalyze-collector-test pgbench -U postgres
docker exec pganalyze-collector-test sh -c "DB_USERNAME=postgres PGA_API_KEY=dummy PGA_DISABLE_ACTIVITY=1 IGNORE_SCHEMA_REGEXP=pgbench_history pganalyze-collector --dry-run --force-state-update -v" > pg92_2.json
docker rm -f pganalyze-collector-test
docker rmi pganalyze-collector-test
if [ "`jq '.collectorErrors' pg92_2.json | tr -d ' \n\r\t '`" != "null" ]; then \
jq '.collectorErrors' pg92_2.json; \
exit 1; \
fi
if jq '.relationReferences' pg92_2.json | grep --quiet pgbench_history; then \
echo "failed to ignore table according to IGNORE_SCHEMA_REGEXP=pgbench_history" \
jq '.relationReferences' pg92_2.json; \
exit 1; \
fi
jq '.queryInformations[].normalizedQuery' pg92_2.json | sort --version-sort -f > pg92.out
diff -Naur pg92.expected pg92.out && echo 'success'
all: pg93 pg94 pg95 pg96 pg10 pg11 pg12 pg13 guided-setup

pg93:
docker build -f Dockerfile.test-pg93 $(DOCKER_BUILD_OPTS)
Expand Down
12 changes: 0 additions & 12 deletions integration_test/pg92.expected

This file was deleted.

2 changes: 1 addition & 1 deletion runner/activity.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ func processActivityForServer(server *state.Server, globalCollectionOpts state.C
}

if activity.Version.Numeric < state.MinRequiredPostgresVersion {
return newState, false, fmt.Errorf("Error: Your PostgreSQL server version (%s) is too old, 9.2 or newer is required", activity.Version.Short)
return newState, false, fmt.Errorf("Error: Your PostgreSQL server version (%s) is too old, 9.3 or newer is required", activity.Version.Short)
}

activity.Backends, err = postgres.GetBackends(logger, connection, activity.Version, server.Config.SystemType)
Expand Down
5 changes: 2 additions & 3 deletions state/postgres_version.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package state

// Known PostgresVersion values - use these for checks in version-dependent code
const (
PostgresVersion92 = 90200
PostgresVersion93 = 90300
PostgresVersion94 = 90400
PostgresVersion95 = 90500
Expand All @@ -12,8 +11,8 @@ const (
PostgresVersion12 = 120000
PostgresVersion13 = 130000

// MinRequiredPostgresVersion - We require PostgreSQL 9.2 or newer, since pg_stat_statements only started being usable then
MinRequiredPostgresVersion = PostgresVersion92
// MinRequiredPostgresVersion - We require PostgreSQL 9.3 or newer
MinRequiredPostgresVersion = PostgresVersion93
)

// PostgresVersion - Identifying information about the PostgreSQL server version and build details
Expand Down

0 comments on commit 10802d9

Please sign in to comment.