Skip to content

Commit 92929d5

Browse files
authored
Quote database name in case it contains a hyphen (#190)
1 parent 6fa0e25 commit 92929d5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

internal/flypg/readonly.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ func changeReadOnlyState(ctx context.Context, n *Node, enable bool) error {
159159
continue
160160
}
161161

162-
sql := fmt.Sprintf("ALTER DATABASE %s SET default_transaction_read_only=%v;", db.Name, enable)
162+
sql := fmt.Sprintf("ALTER DATABASE %q SET default_transaction_read_only=%v;", db.Name, enable)
163163
if _, err = conn.Exec(ctx, sql); err != nil {
164164
return fmt.Errorf("failed to alter readonly state on db %s: %s", db.Name, err)
165165
}

0 commit comments

Comments
 (0)