Skip to content

Commit de0b0a2

Browse files
committed
Merge branch 'custom-physical-restore' into 'master'
fix: not to set up restore options if restore_command is empty(#153) See merge request postgres-ai/database-lab!159
2 parents ea6a6e6 + f6ba131 commit de0b0a2

File tree

1 file changed

+4
-2
lines changed
  • pkg/retrieval/engine/postgres/physical

1 file changed

+4
-2
lines changed

pkg/retrieval/engine/postgres/physical/custom.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,10 @@ func (c *custom) GetRestoreCommand() string {
4949
func (c *custom) GetRecoveryConfig() []byte {
5050
buffer := bytes.Buffer{}
5151

52-
buffer.WriteString("standby_mode = 'on'\n")
53-
buffer.WriteString(fmt.Sprintf("restore_command = '%s'\n", c.options.RestoreCommand))
52+
if c.options.RestoreCommand != "" {
53+
buffer.WriteString("standby_mode = 'on'\n")
54+
buffer.WriteString(fmt.Sprintf("restore_command = '%s'\n", c.options.RestoreCommand))
55+
}
5456

5557
return buffer.Bytes()
5658
}

0 commit comments

Comments
 (0)