Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion internal/postgresConfig/update/update.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ func Run(ctx context.Context, projectRef string, values []string, replaceOverrid
}
// statement_timeout and wal_sender_timeout must be typed as string
for k, v := range finalOverrides {
if _, ok := v.(string); strings.HasSuffix(k, "_timeout") && !ok {
if _, ok := v.(string); strings.HasSuffix(k, "statement_timeout") || strings.HasSuffix(k, "wal_sender_timeout") && !ok {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should fix the type for checkpoint_timeout on api side. This param can be specified with units ie. 5min, in which case it must be a string. https://postgresqlco.nf/doc/en/param/checkpoint_timeout/

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We set the timeout to only be set in seconds as an integer to prevent syntax issues bringing the database down (i.e. 10mins, 5min)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Those malformed values are validated and rejected by api for other timeouts.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have seen a few failing cases but will fix in the API in that case!

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have seen a few failing cases but will fix in the API in that case!

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have seen a few failing cases but will fix in the API in that case!

finalOverrides[k] = fmt.Sprintf("%v", v)
}
}
Expand Down
Loading