Repository: cloudnative-pg/cloudnative-pg

Issue:
[Bug]: code for version 12 and earlier is still present
### Is there an existing issue already for this bug?

- [x] I have searched for an existing issue, and could not find anything. I believe this is a new bug.

### I have read the troubleshooting guide

- [x] I have read the troubleshooting guide and I think this is a new bug.

### I am running a supported version of CloudNativePG

- [x] I have read the troubleshooting guide and I think this is a new bug.

### Contact Details

_No response_

### Version

1.26.0-rc1

### What version of Kubernetes are you using?

1.32

### What is your Kubernetes environment?

Self-managed: kind (evaluation)

### How did you install the operator?

YAML manifest

### What happened?

There are multiple references in the code to pg version 12 and earlier, which are out of support. We can simplify the code removing those.

### Cluster resource

```shell

```

### Relevant log output

```shell

```

### Code of Conduct

- [x] I agree to follow this project's Code of Conduct

Discussion:

Solution patch:
diff --git a/docs/src/database_import.md b/docs/src/database_import.md
index 1c19a501..1fb3e6a9 100644
--- a/docs/src/database_import.md
+++ b/docs/src/database_import.md
@@ -18,8 +18,8 @@ As a result, the instructions in this section are suitable for both:
 - importing one or more databases from an existing PostgreSQL instance, even
   outside Kubernetes
 - importing the database from any PostgreSQL version to one that is either the
-  same or newer, enabling *major upgrades* of PostgreSQL (e.g. from version 11.x
-  to version 15.x)
+  same or newer, enabling *major upgrades* of PostgreSQL (e.g. from version 13.x
+  to version 17.x)
 
 !!! Warning
     When performing major upgrades of PostgreSQL you are responsible for making
@@ -316,4 +316,3 @@ upgrades.
 
 For more details, including limitations and best practices, refer to the
 [Logical Replication](logical_replication.md) section in the documentation.
-
diff --git a/docs/src/postgresql_conf.md b/docs/src/postgresql_conf.md
index 6c1660ac..d547767a 100644
--- a/docs/src/postgresql_conf.md
+++ b/docs/src/postgresql_conf.md
@@ -65,7 +65,7 @@ operator by applying the following sections in this order:
 The **global default parameters** are:
 
 ```text
-archive_mode = 'on'
+archive_timeout = '5min'
 dynamic_shared_memory_type = 'posix'
 full_page_writes = 'on'
 logging_collector = 'on'
@@ -78,9 +78,11 @@ log_truncate_on_rotation = 'false'
 max_parallel_workers = '32'
 max_replication_slots = '32'
 max_worker_processes = '32'
-shared_memory_type = 'mmap' # for PostgreSQL >= 12 only
-wal_keep_size = '512MB' # for PostgreSQL >= 13 only
-wal_keep_segments = '32' # for PostgreSQL <= 12 only
+shared_memory_type = 'mmap'
+shared_preload_libraries = ''
+ssl_max_protocol_version = 'TLSv1.3'
+ssl_min_protocol_version = 'TLSv1.3'
+wal_keep_size = '512MB'
 wal_level = 'logical'
 wal_log_hints = 'on'
 wal_sender_timeout = '5s'
diff --git a/internal/cmd/manager/instance/pgbasebackup/cmd.go b/internal/cmd/manager/instance/pgbasebackup/cmd.go
index d3f74879..8196994f 100644
--- a/internal/cmd/manager/instance/pgbasebackup/cmd.go
+++ b/internal/cmd/manager/instance/pgbasebackup/cmd.go
@@ -105,8 +105,6 @@ func NewCmd() *cobra.Command {
 
 // bootstrapUsingPgbasebackup creates a new data dir from the configuration
 func (env *CloneInfo) bootstrapUsingPgbasebackup(ctx context.Context) error {
-	contextLogger := log.FromContext(ctx)
-
 	var cluster apiv1.Cluster
 	err := env.client.Get(ctx, ctrl.ObjectKey{Namespace: env.info.Namespace, Name: env.info.ClusterName}, &cluster)
 	if err != nil {
@@ -134,22 +132,13 @@ func (env *CloneInfo) bootstrapUsingPgbasebackup(ctx context.Context) error {
 		return err
 	}
 
-	pgVersion, err := cluster.GetPostgresqlVersion()
-	if err != nil {
-		contextLogger.Warning(
-			"Error while parsing PostgreSQL server version to define connection options, defaulting to PostgreSQL 11",
-			"imageName", cluster.Status.Image,
-			"err", err)
-	} else if pgVersion.Major() >= 12 {
-		// We explicitly disable wal_sender_timeout for join-related pg_basebackup executions.
-		// A short timeout could not be enough in case the instance is slow to send data,
-		// like when the I/O is overloaded.
-		connectionString += " options='-c wal_sender_timeout=0s'"
-	}
+	// We explicitly disable wal_sender_timeout for join-related pg_basebackup executions.
+	// A short timeout could not be enough in case the instance is slow to send data,
+	// like when the I/O is overloaded.
+	connectionString += " options='-c wal_sender_timeout=0s'"
 
-	err = postgres.ClonePgData(ctx, connectionString, env.info.PgData, env.info.PgWal)
-	if err != nil {
-		return err
+	if err := postgres.ClonePgData(ctx, connectionString, env.info.PgData, env.info.PgWal); err != nil {
+		return fmt.Errorf("while cloning pgdata: %w", err)
 	}
 
 	if cluster.IsReplica() {
diff --git a/internal/cmd/manager/instance/run/lifecycle/run.go b/internal/cmd/manager/instance/run/lifecycle/run.go
index acce529c..f5be4fae 100644
--- a/internal/cmd/manager/instance/run/lifecycle/run.go
+++ b/internal/cmd/manager/instance/run/lifecycle/run.go
@@ -22,16 +22,15 @@ package lifecycle
 import (
 	"context"
 	"database/sql"
+	"errors"
 	"fmt"
 	"sync"
 
-	"github.com/blang/semver"
 	"github.com/cloudnative-pg/machinery/pkg/log"
 	"github.com/jackc/pgx/v5"
 
 	apiv1 "github.com/cloudnative-pg/cloudnative-pg/api/v1"
 	"github.com/cloudnative-pg/cloudnative-pg/pkg/management/postgres"
-	postgresutils "github.com/cloudnative-pg/cloudnative-pg/pkg/management/postgres/utils"
 )
 
 var identifierStreamingReplicationUser = pgx.Identifier{apiv1.StreamingReplicationUser}.Sanitize()
@@ -153,11 +152,6 @@ func configureInstancePermissions(ctx context.Context, instance *postgres.Instan
 		return nil
 	}
 
-	pgVersion, err := postgresutils.GetPgdataVersion(instance.PgData)
-	if err != nil {
-		return fmt.Errorf("while getting major version: %w", err)
-	}
-
 	db, err := instance.GetSuperUserDB()
 	if err != nil {
 		return fmt.Errorf("while getting a connection to the instance: %w", err)
@@ -177,14 +171,12 @@ func configureInstancePermissions(ctx context.Context, instance *postgres.Instan
 		return fmt.Errorf("creating a new transaction to setup the instance: %w", err)
 	}
 
-	hasSuperuser, err := configureStreamingReplicaUser(tx)
-	if err != nil {
+	if err := configureStreamingReplicaUser(tx); err != nil {
 		_ = tx.Rollback()
 		return err
 	}
 
-	err = configurePgRewindPrivileges(pgVersion, hasSuperuser, tx)
-	if err != nil {
+	if err = configurePgRewindPrivileges(tx); err != nil {
 		_ = tx.Rollback()
 		return err
 	}
@@ -194,28 +186,28 @@ func configureInstancePermissions(ctx context.Context, instance *postgres.Instan
 
 // configureStreamingReplicaUser makes sure the streaming replication user exists
 // and has the required rights
-func configureStreamingReplicaUser(tx *sql.Tx) (bool, error) {
-	var hasLoginRight, hasReplicationRight, hasSuperuser bool
-	row := tx.QueryRow("SELECT rolcanlogin, rolreplication, rolsuper FROM pg_catalog.pg_roles WHERE rolname = $1",
+func configureStreamingReplicaUser(tx *sql.Tx) error {
+	var hasLoginRight, hasReplicationRight bool
+	row := tx.QueryRow("SELECT rolcanlogin, rolreplication FROM pg_catalog.pg_roles WHERE rolname = $1",
 		apiv1.StreamingReplicationUser)
-	err := row.Scan(&hasLoginRight, &hasReplicationRight, &hasSuperuser)
+	err := row.Scan(&hasLoginRight, &hasReplicationRight)
 	if err != nil {
-		if err != sql.ErrNoRows {
-			return false, fmt.Errorf("while creating streaming replication user: %w", err)
+		if !errors.Is(err, sql.ErrNoRows) {
+			return fmt.Errorf("while getting streaming replication user privileges: %w", err)
 		}
 
 		_, err = tx.Exec(fmt.Sprintf(
 			"CREATE USER %v REPLICATION",
 			identifierStreamingReplicationUser))
 		if err != nil {
-			return false, fmt.Errorf("CREATE USER %v error: %w", apiv1.StreamingReplicationUser, err)
+			return fmt.Errorf("CREATE USER %v error: %w", apiv1.StreamingReplicationUser, err)
 		}
 
 		_, err = tx.Exec(fmt.Sprintf(
 			"COMMENT ON ROLE %v IS 'Special user for streaming replication created by CloudNativePG'",
 			identifierStreamingReplicationUser))
 		if err != nil {
-			return false, fmt.Errorf("COMMENT ON ROLE %v error: %w", apiv1.StreamingReplicationUser, err)
+			return fmt.Errorf("COMMENT ON ROLE %v error: %w", apiv1.StreamingReplicationUser, err)
 		}
 	}
 
@@ -224,28 +216,14 @@ func configureStreamingReplicaUser(tx *sql.Tx) (bool, error) {
 			"ALTER USER %v LOGIN REPLICATION",
 			identifierStreamingReplicationUser))
 		if err != nil {
-			return false, fmt.Errorf("ALTER USER %v error: %w", apiv1.StreamingReplicationUser, err)
+			return fmt.Errorf("ALTER USER %v error: %w", apiv1.StreamingReplicationUser, err)
 		}
 	}
-	return hasSuperuser, nil
+	return nil
 }
 
 // configurePgRewindPrivileges ensures that the StreamingReplicationUser has enough rights to execute pg_rewind
-func configurePgRewindPrivileges(pgVersion semver.Version, hasSuperuser bool, tx *sql.Tx) error {
-	// We need the superuser bit for the streaming-replication user since pg_rewind in PostgreSQL <= 10
-	// will require it.
-	if pgVersion.Major <= 10 {
-		if !hasSuperuser {
-			_, err := tx.Exec(fmt.Sprintf(
-				"ALTER USER %v SUPERUSER",
-				identifierStreamingReplicationUser))
-			if err != nil {
-				return fmt.Errorf("ALTER USER %v error: %w", apiv1.StreamingReplicationUser, err)
-			}
-		}
-		return nil
-	}
-
+func configurePgRewindPrivileges(tx *sql.Tx) error {
 	// Ensure the user has rights to execute the functions needed for pg_rewind
 	var hasPgRewindPrivileges bool
 	row := tx.QueryRow(
diff --git a/internal/webhook/v1/cluster_webhook.go b/internal/webhook/v1/cluster_webhook.go
index b5292fa8..6301dda2 100644
--- a/internal/webhook/v1/cluster_webhook.go
+++ b/internal/webhook/v1/cluster_webhook.go
@@ -107,7 +107,8 @@ func (v *ClusterCustomValidator) ValidateCreate(_ context.Context, obj runtime.O
 	if !ok {
 		return nil, fmt.Errorf("expected a Cluster object but got %T", obj)
 	}
-	clusterLog.Info("Validation for Cluster upon creation", "name", cluster.GetName(), "namespace", cluster.GetNamespace())
+	clusterLog.Info("Validation for Cluster upon creation", "name", cluster.GetName(), "namespace",
+		cluster.GetNamespace())
 
 	allErrs := v.validate(cluster)
 	allWarnings := v.getAdmissionWarnings(cluster)
@@ -136,7 +137,8 @@ func (v *ClusterCustomValidator) ValidateUpdate(
 		return nil, fmt.Errorf("expected a Cluster object for the oldObj but got %T", oldObj)
 	}
 
-	clusterLog.Info("Validation for Cluster upon update", "name", cluster.GetName(), "namespace", cluster.GetNamespace())
+	clusterLog.Info("Validation for Cluster upon update", "name", cluster.GetName(), "namespace",
+		cluster.GetNamespace())
 
 	// applying defaults before validating updates to set any new default
 	oldCluster.SetDefaults()
@@ -162,7 +164,8 @@ func (v *ClusterCustomValidator) ValidateDelete(_ context.Context, obj runtime.O
 	if !ok {
 		return nil, fmt.Errorf("expected a Cluster object but got %T", obj)
 	}
-	clusterLog.Info("Validation for Cluster upon deletion", "name", cluster.GetName(), "namespace", cluster.GetNamespace())
+	clusterLog.Info("Validation for Cluster upon deletion", "name", cluster.GetName(), "namespace",
+		cluster.GetNamespace())
 
 	// TODO(user): fill in your validation logic upon object deletion.
 
@@ -954,12 +957,12 @@ func (v *ClusterCustomValidator) validateConfiguration(r *apiv1.Cluster) field.E
 		// validateImageName function
 		return result
 	}
-	if pgVersion.Major() < 12 {
+	if pgVersion.Major() < 13 {
 		result = append(result,
 			field.Invalid(
 				field.NewPath("spec", "imageName"),
 				r.Spec.ImageName,
-				"Unsupported PostgreSQL version. Versions 12 or newer are supported"))
+				"Unsupported PostgreSQL version. Versions 13 or newer are supported"))
 	}
 	info := postgres.ConfigurationInfo{
 		Settings:               postgres.CnpgConfigurationSettings,
diff --git a/pkg/management/postgres/join.go b/pkg/management/postgres/join.go
index fda8bdcd..d800ceaa 100644
--- a/pkg/management/postgres/join.go
+++ b/pkg/management/postgres/join.go
@@ -77,29 +77,21 @@ func ClonePgData(ctx context.Context, connectionString, targetPgData, walDir str
 func (info InitInfo) Join(ctx context.Context, cluster *apiv1.Cluster) error {
 	primaryConnInfo := buildPrimaryConnInfo(info.ParentNode, info.PodName) + " dbname=postgres connect_timeout=5"
 
-	pgVersion, err := cluster.GetPostgresqlVersion()
-	if err != nil {
-		log.Warning(
-			"Error while parsing PostgreSQL server version to define connection options, defaulting to PostgreSQL 11",
-			"image", cluster.Status.Image,
-			"err", err)
-	} else if pgVersion.Major() >= 12 {
-		// We explicitly disable wal_sender_timeout for join-related pg_basebackup executions.
-		// A short timeout could not be enough in case the instance is slow to send data,
-		// like when the I/O is overloaded.
-		primaryConnInfo += " options='-c wal_sender_timeout=0s'"
-	}
+	// We explicitly disable wal_sender_timeout for join-related pg_basebackup executions.
+	// A short timeout could not be enough in case the instance is slow to send data,
+	// like when the I/O is overloaded.
+	primaryConnInfo += " options='-c wal_sender_timeout=0s'"
 
 	coredumpFilter := cluster.GetCoredumpFilter()
 	if err := system.SetCoredumpFilter(coredumpFilter); err != nil {
 		return err
 	}
 
-	if err = ClonePgData(ctx, primaryConnInfo, info.PgData, info.PgWal); err != nil {
+	if err := ClonePgData(ctx, primaryConnInfo, info.PgData, info.PgWal); err != nil {
 		return err
 	}
 
 	slotName := cluster.GetSlotNameFromInstanceName(info.PodName)
-	_, err = UpdateReplicaConfiguration(info.PgData, info.GetPrimaryConnInfo(), slotName)
+	_, err := UpdateReplicaConfiguration(info.PgData, info.GetPrimaryConnInfo(), slotName)
 	return err
 }
diff --git a/pkg/postgres/configuration.go b/pkg/postgres/configuration.go
index 12fabdfc..936de3c1 100644
--- a/pkg/postgres/configuration.go
+++ b/pkg/postgres/configuration.go
@@ -475,64 +475,52 @@ var (
 	CnpgConfigurationSettings = ConfigurationSettings{
 		GlobalDefaultSettings: SettingsCollection{
 			"archive_timeout":            "5min",
+			"dynamic_shared_memory_type": "posix",
 			"full_page_writes":           "on",
-			"max_parallel_workers":       "32",
-			"max_worker_processes":       "32",
-			"max_replication_slots":      "32",
 			"logging_collector":          "on",
 			"log_destination":            "csvlog",
+			"log_directory":              LogPath,
+			"log_filename":               LogFileName,
 			"log_rotation_age":           "0",
 			"log_rotation_size":          "0",
 			"log_truncate_on_rotation":   "false",
-			"log_directory":              LogPath,
-			"log_filename":               LogFileName,
-			"dynamic_shared_memory_type": "posix",
-			"wal_sender_timeout":         "5s",
-			"wal_receiver_timeout":       "5s",
+			"max_parallel_workers":       "32",
+			"max_worker_processes":       "32",
+			"max_replication_slots":      "32",
+			"shared_memory_type":         "mmap",
+			"ssl_max_protocol_version":   "TLSv1.3",
+			"ssl_min_protocol_version":   "TLSv1.3",
+			"wal_keep_size":              "512MB",
 			"wal_level":                  "logical",
 			ParameterWalLogHints:         "on",
+			"wal_sender_timeout":         "5s",
+			"wal_receiver_timeout":       "5s",
 			// Workaround for PostgreSQL not behaving correctly when
 			// a default value is not explicit in the postgresql.conf and
 			// the parameter cannot be changed without a restart.
 			SharedPreloadLibraries: "",
 		},
-		DefaultSettings: map[VersionRange]SettingsCollection{
-			{MajorVersionRangeUnlimited, version.New(12, 0)}: {
-				"wal_keep_segments": "32",
-			},
-			{version.New(12, 0), version.New(13, 0)}: {
-				"wal_keep_segments":  "32",
-				"shared_memory_type": "mmap",
-			},
-			{version.New(13, 0), MajorVersionRangeUnlimited}: {
-				"wal_keep_size":      "512MB",
-				"shared_memory_type": "mmap",
-			},
-			{version.New(12, 0), MajorVersionRangeUnlimited}: {
-				"ssl_max_protocol_version": "TLSv1.3",
-				"ssl_min_protocol_version": "TLSv1.3",
-			},
-		},
 		MandatorySettings: SettingsCollection{
-			"listen_addresses":        "*",
-			"unix_socket_directories": SocketDirectory,
-			"hot_standby":             "true",
 			"archive_command": fmt.Sprintf(
 				"/controller/manager wal-archive --log-destination %s/%s.json %%p",
 				LogPath, LogFileName),
-			"port":                fmt.Sprint(ServerPort),
-			"ssl":                 "on",
-			"ssl_cert_file":       ServerCertificateLocation,
-			"ssl_key_file":        ServerKeyLocation,
-			"ssl_ca_file":         ClientCACertificateLocation,
-			"restart_after_crash": "false",
+			"hot_standby":             "true",
+			"listen_addresses":        "*",
+			"port":                    fmt.Sprint(ServerPort),
+			"restart_after_crash":     "false",
+			"ssl":                     "on",
+			"ssl_cert_file":           ServerCertificateLocation,
+			"ssl_key_file":            ServerKeyLocation,
+			"ssl_ca_file":             ClientCACertificateLocation,
+			"unix_socket_directories": SocketDirectory,
 		},
 	}
 )
 
 // CreateHBARules will create the content of pg_hba.conf file given
 // the rules set by the cluster spec
-func CreateHBARules(hba []string,
+func CreateHBARules(
+	hba []string,
 	defaultAuthenticationMethod, ldapConfigString string,
 ) (string, error) {
 	var hbaContent bytes.Buffer



Test patch:
diff --git a/internal/controller/cluster_image_test.go b/internal/controller/cluster_image_test.go
index e76c58e9..5e9644d5 100644
--- a/internal/controller/cluster_image_test.go
+++ b/internal/controller/cluster_image_test.go
@@ -150,8 +150,8 @@ var _ = Describe("Cluster image detection", func() {
 			Spec: apiv1.ImageCatalogSpec{
 				Images: []apiv1.CatalogImage{
 					{
-						Image: "postgres:11.2",
-						Major: 11,
+						Image: "postgres:17.4",
+						Major: 17,
 					},
 				},
 			},
diff --git a/internal/webhook/v1/cluster_webhook_test.go b/internal/webhook/v1/cluster_webhook_test.go
index ae22f9d0..c2666157 100644
--- a/internal/webhook/v1/cluster_webhook_test.go
+++ b/internal/webhook/v1/cluster_webhook_test.go
@@ -1030,6 +1030,23 @@ var _ = Describe("configuration change validation", func() {
 		Expect(v.validateConfiguration(cluster)).To(HaveLen(1))
 	})
 
+	It("rejects PostgreSQL version lower than 13", func() {
+		v := &ClusterCustomValidator{}
+
+		cluster := &apiv1.Cluster{
+			Spec: apiv1.ClusterSpec{
+				ImageName: "postgres:12",
+			},
+		}
+
+		result := v.validateConfiguration(cluster)
+
+		Expect(result).To(HaveLen(1))
+		Expect(result[0].Field).To(Equal("spec.imageName"))
+		Expect(result[0].Detail).To(ContainSubstring("Unsupported PostgreSQL version"))
+		Expect(result[0].Detail).To(ContainSubstring("Versions 13 or newer are supported"))
+	})
+
 	It("should disallow changing wal_level to minimal for existing clusters", func() {
 		oldCluster := &apiv1.Cluster{
 			ObjectMeta: metav1.ObjectMeta{
diff --git a/pkg/management/postgres/logpipe/logpipe_test.go b/pkg/management/postgres/logpipe/logpipe_test.go
index 28fc736b..1f622003 100644
--- a/pkg/management/postgres/logpipe/logpipe_test.go
+++ b/pkg/management/postgres/logpipe/logpipe_test.go
@@ -57,22 +57,6 @@ var _ = Describe("CSV file reader", func() {
 			Expect(spy.records).To(HaveLen(2))
 		})
 
-		It("can read multiple CSV lines on PostgreSQL version <= 12", func(ctx SpecContext) {
-			f, err := os.Open("testdata/two_lines_12.csv")
-			defer func() {
-				_ = f.Close()
-			}()
-			Expect(err).ToNot(HaveOccurred())
-
-			spy := SpyRecordWriter{}
-			p := LogPipe{
-				record:          &LoggingRecord{},
-				fieldsValidator: LogFieldValidator,
-			}
-			Expect(p.streamLogFromCSVFile(ctx, f, &spy)).To(Succeed())
-			Expect(spy.records).To(HaveLen(2))
-		})
-
 		It("can read multiple CSV lines on PostgreSQL version == 14", func(ctx SpecContext) {
 			f, err := os.Open("testdata/two_lines_14.csv")
 			defer func() {
diff --git a/pkg/management/postgres/logpipe/testdata/two_lines_12.csv b/pkg/management/postgres/logpipe/testdata/two_lines_12.csv
deleted file mode 100644
index 84b39d6e..00000000
--- a/pkg/management/postgres/logpipe/testdata/two_lines_12.csv
+++ /dev/null
@@ -1,2 +0,0 @@
-2021-05-10 06:25:24.239 UTC,,,9298,,601c20b5.2452,61853,,2021-02-04 16:28:37 UTC,,0,LOG,00000,"checkpoint starting: time",,,,,,,,,""
-2021-05-10 06:25:30.200 UTC,,,9298,,601c20b5.2452,61854,,2021-02-04 16:28:37 UTC,,0,LOG,00000,"checkpoint complete: wrote 59 buffers (0.0%); 0 WAL file(s) added, 0 removed, 1 recycled; write=5.937 s, sync=0.004 s, total=5.961 s; sync files=7, longest=0.002 s, average=0.000 s; distance=16415 kB, estimate=16910 kB",,,,,,,,,""
\ No newline at end of file
diff --git a/pkg/management/postgres/probes_test.go b/pkg/management/postgres/probes_test.go
index bf1abc68..627823e7 100644
--- a/pkg/management/postgres/probes_test.go
+++ b/pkg/management/postgres/probes_test.go
@@ -93,13 +93,6 @@ var _ = Describe("probes", func() {
 	})
 
 	Context("Fill basebackup stats", func() {
-		It("does nothing in case of that major version is less than 13 ", func() {
-			instance := &Instance{
-				pgVersion: &semver.Version{Major: 12},
-			}
-			Expect(instance.fillBasebackupStats(nil, nil)).To(Succeed())
-		})
-
 		It("set the information", func() {
 			instance := (&Instance{
 				pgVersion: &semver.Version{Major: 13},
diff --git a/pkg/postgres/configuration_test.go b/pkg/postgres/configuration_test.go
index 8d1bacac..68adc286 100644
--- a/pkg/postgres/configuration_test.go
+++ b/pkg/postgres/configuration_test.go
@@ -83,19 +83,6 @@ var _ = Describe("PostgreSQL configuration creation", func() {
 		Expect(confFile).To(ContainSubstring("log_destination = 'stderr'\nshared_buffers = '128KB'\n"))
 	})
 
-	When("version is 10", func() {
-		It("will use appropriate settings", func() {
-			info := ConfigurationInfo{
-				Settings:           CnpgConfigurationSettings,
-				Version:            version.New(10, 0),
-				UserSettings:       settings,
-				IncludingMandatory: true,
-			}
-			config := CreatePostgresqlConfiguration(info)
-			Expect(config.GetConfig("wal_keep_segments")).To(Equal("32"))
-		})
-	})
-
 	When("version is 13", func() {
 		It("will use appropriate settings", func() {
 			info := ConfigurationInfo{
diff --git a/tests/e2e/replication_slot_test.go b/tests/e2e/replication_slot_test.go
index e858ab53..9db01a5c 100644
--- a/tests/e2e/replication_slot_test.go
+++ b/tests/e2e/replication_slot_test.go
@@ -73,13 +73,6 @@ var _ = Describe("Replication Slot", Label(tests.LabelReplication), func() {
 			}, 10, 2).Should(BeTrue())
 		})
 
-		if env.PostgresVersion == 11 {
-			// We need to take into account the fact that on PostgreSQL 11
-			// it is required to rolling restart the cluster to
-			// enable or disable the feature once the cluster is created.
-			AssertClusterRollingRestart(namespace, clusterName)
-		}
-
 		By("checking Primary HA slots exist and are active", func() {
 			primaryPod, err := clusterutils.GetPrimary(env.Ctx, env.Client, namespace, clusterName)
 			Expect(err).ToNot(HaveOccurred())
@@ -167,13 +160,6 @@ var _ = Describe("Replication Slot", Label(tests.LabelReplication), func() {
 			}, 10, 2).Should(BeFalse())
 		})
 
-		if env.PostgresVersion == 11 {
-			// We need to take into account the fact that on PostgreSQL 11
-			// it is required to rolling restart the cluster to
-			// enable or disable the feature once the cluster is created.
-			AssertClusterRollingRestart(namespace, clusterName)
-		}
-
 		By("verifying slots have been removed from the cluster's pods", func() {
 			pods, err := clusterutils.ListPods(env.Ctx, env.Client, namespace, clusterName)
 			Expect(err).ToNot(HaveOccurred())