That seems like a really arbitrary number of milliseconds to use as a maximum. What can I do if I want to log even longer-running queries on a data warehouse?

C.f. https://collabshot.com/show/83dd1e

1 Answer 1


This is not specific to AWS RDS (well part of it specific to that), it is in the upstream code.

The setting is restricted to INT_MAX / 1000. But I can't figure out why, as that setting is never multiplied by anything, much less 1000. This seems like a bug to me. You might want to report it to the PostgreSQL bugs mailing list.

In the meantime, I guess your option would be to set it to the max and then filter your log files. It seems unlikely to have millions of queries each taking 40 minutes, so filtering it shouldn't be too onerous.


And soon after your report, it has been fixed in PostgreSQL for all supported versions. It will be included in the next bugfix release, which is due out soon. I don't know when Amazon is likely to both roll out the next bugfix release to RDS, and fix their own independent bug on the same subject matter.

  • Thanks for your answer. Actually, I'm not the one missing the digit--see the screenshot, it's like that in the range that AWS reports (and coming from PostgreSQL directly, it sounds like). Thanks again, I'll follow up with them.
    – Kev
    Feb 21, 2018 at 18:18
  • Actually, it sounds like PostgreSQL may have a bug, but AWS also has one (typo, perhaps? The digit it's missing is 3rd from the right-hand side...) E.g. if I try to set it to 2000000, which is below the number you specified, I get Error saving: Value: 2000000 is outside of range: -1-214783 for parameter: auto_explain.log_min_duration (Service: AmazonRDS; Status Code: 400; Error Code: InvalidParameterValue; Request ID: ...)
    – Kev
    Feb 21, 2018 at 18:55
  • Just a follow-up, the answer from pg-bugs was that some unknown time buffer is needed.
    – Kev
    Feb 23, 2018 at 19:08
  • AWS staff also responded and said they would be fixing it, but without a timeline.
    – Kev
    Feb 27, 2018 at 18:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.