From 07806cd2566de293cbb7ab6a847af2a2cc946b7f Mon Sep 17 00:00:00 2001 From: Bruce Harrison Date: Mon, 18 Aug 2025 21:35:40 -0500 Subject: [PATCH] Allow dashes in database name, simplify regex expression --- pkg/cluster/cluster.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/cluster/cluster.go b/pkg/cluster/cluster.go index e9a691faa..14274a208 100644 --- a/pkg/cluster/cluster.go +++ b/pkg/cluster/cluster.go @@ -42,7 +42,7 @@ import ( var ( alphaNumericRegexp = regexp.MustCompile("^[a-zA-Z][a-zA-Z0-9]*$") - databaseNameRegexp = regexp.MustCompile("^[a-zA-Z_][a-zA-Z0-9_]*$") + databaseNameRegexp = regexp.MustCompile("^[\w-]*$") userRegexp = regexp.MustCompile(`^[a-z0-9]([-_a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-_a-z0-9]*[a-z0-9])?)*$`) patroniObjectSuffixes = []string{"leader", "config", "sync", "failover"} finalizerName = "postgres-operator.acid.zalan.do"