MCPcopy Index your code
hub / github.com/zalando/postgres-operator / databaseNameOwnerValid

Method databaseNameOwnerValid

pkg/cluster/database.go:391–402  ·  view source on GitHub ↗
(databaseName, owner string)

Source from the content-addressed store, hash-verified

389}
390
391func (c *Cluster) databaseNameOwnerValid(databaseName, owner string) bool {
392 if _, ok := c.pgUsers[owner]; !ok {
393 c.logger.Infof("skipping creation of the %q database, user %q does not exist", databaseName, owner)
394 return false
395 }
396
397 if !databaseNameRegexp.MatchString(databaseName) {
398 c.logger.Infof("database %q has invalid name", databaseName)
399 return false
400 }
401 return true
402}
403
404// getSchemas returns the list of current database schemas
405// The caller is responsible for opening and closing the database connection

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected