From cd8885da791442961563acee6348098e468a1d44 Mon Sep 17 00:00:00 2001 From: Aaron Peschel Date: Thu, 20 Jul 2023 01:26:17 -0700 Subject: [PATCH] Correct the Database Connection (#120) Using the correct db connection for ALTER schema operations. --- pkg/postgres/database.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/postgres/database.go b/pkg/postgres/database.go index 69f482da..eaf9add7 100644 --- a/pkg/postgres/database.go +++ b/pkg/postgres/database.go @@ -59,7 +59,7 @@ func (c *pg) CreateSchema(db, role, schema string, logger logr.Logger) error { // Set the schema owner in a separate step, because AWS RDS breaks if // you try to create a schema and set the owner in a single command. // See: https://github.com/movetokube/postgres-operator/issues/91 - _, err = c.db.Exec(fmt.Sprintf(ALTER_SCHEMA_OWNER, schema, role)) + _, err = tmpDb.Exec(fmt.Sprintf(ALTER_SCHEMA_OWNER, schema, role)) if err != nil { return err }