Skip to content

Commit

Permalink
create a createdb.sql for all dbs but template0
Browse files Browse the repository at this point in the history
  • Loading branch information
orgrim committed Dec 24, 2021
1 parent 4a11694 commit 21dd26e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sql.go
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ func dumpCreateDBAndACL(db *pg, dbname string, force bool) (string, error) {
return "", fmt.Errorf("could not get row: %s", err)
}

if dbname != "template1" && dbname != "postgres" {
if dbname != "template0" {
s += fmt.Sprintf("--\n-- Database creation\n--\n\n")
s += fmt.Sprintf("CREATE DATABASE \"%s\" WITH TEMPLATE = template0 OWNER = \"%s\"", sqlQuoteIdent(dbname), sqlQuoteIdent(owner))
s += fmt.Sprintf(" ENCODING = %s", sqlQuoteLiteral(encoding))
Expand Down

0 comments on commit 21dd26e

Please sign in to comment.