Signed-off-by: Andrew Thornton <art27@cantab.net>
This commit is contained in:
Andrew Thornton 2022-01-04 19:42:20 +00:00
parent b772658c0b
commit 129043e50d
No known key found for this signature in database
GPG Key ID: 3CDE74631F13A748
1 changed files with 1 additions and 1 deletions

View File

@ -490,7 +490,7 @@ func (engine *Engine) dumpTables(ctx context.Context, tables []*schemas.Table, w
return err
}
} else if dstDialect.URI().DBType == schemas.POSTGRES && engine.dialect.URI().Schema != "" {
if _, err := fmt.Fprintf(w, `SELECT set_config('search_path', '%s,' || current_setting('search_path'), false)`, strings.ReplaceAll(engine.dialect.URI().Schema, "'", "''")); err != nil {
if _, err := fmt.Fprintf(w, `SELECT set_config('search_path', '%s,' || current_setting('search_path'), false);`+"\n", strings.ReplaceAll(engine.dialect.URI().Schema, "'", "''")); err != nil {
return err
}
}