fix: Typo
This commit is contained in:
@@ -178,7 +178,7 @@ func (e *Engine) restorePostgreSQLDumpWithOwnership(ctx context.Context, archive
|
||||
// Build restore command with ownership control
|
||||
opts := database.RestoreOptions{
|
||||
Parallel: 1,
|
||||
Clean: false, // We already dropped the database
|
||||
Clean: false, // We already dropped the database
|
||||
NoOwner: !preserveOwnership, // Preserve ownership if we're superuser
|
||||
NoPrivileges: !preserveOwnership, // Preserve privileges if we're superuser
|
||||
SingleTransaction: true,
|
||||
@@ -854,9 +854,9 @@ func (e *Engine) ensureDatabaseExists(ctx context.Context, dbName string) error
|
||||
|
||||
output, err = createCmd.CombinedOutput()
|
||||
if err != nil {
|
||||
// Log the error but don't fail - pg_restore might handle it
|
||||
// Log the error and include the psql output in the returned error to aid debugging
|
||||
e.log.Warn("Database creation failed", "name", dbName, "error", err, "output", string(output))
|
||||
return fmt.Errorf("failed to create database '%s': %w", dbName, err)
|
||||
return fmt.Errorf("failed to create database '%s': %w (output: %s)", dbName, err, strings.TrimSpace(string(output)))
|
||||
}
|
||||
|
||||
e.log.Info("Successfully created database", "name", dbName)
|
||||
|
||||
Reference in New Issue
Block a user