postgres-operator icon indicating copy to clipboard operation
postgres-operator copied to clipboard

[question]About username creation rules

Open jiangshuai1995 opened this issue 2 years ago • 0 comments

This is a question

version: v4.6.2

I want to create users with underscores, but CreateUser contains those code

	// NOTE: this is a legacy requirement as the uesrname is kept in the name of
	// the secret, which requires RFC 1035 compliance. We could probably update
	// this check as well to be more accurate, and even more the MustCompile
	// statement to being a file-level constant, but for now this is just going
	// to sit here and changed in a planned later commit.
	re := regexp.MustCompile("^[a-z0-9.-]*$")
	if !re.MatchString(request.Username) {
		response.Status.Code = msgs.Error
		response.Status.Msg = "user name is required to contain lowercase letters, numbers, '.' and '-' only."
		return response
	}

For my program, a username with an underscore is necessary, I don't understand why the database user name cannot be underlined

I wonder if this is just an compliance,

If I modify here and use users with underscores, will there be a serious problem?

jiangshuai1995 avatar Aug 25 '22 15:08 jiangshuai1995