Postgres work_mem range error

Kobi Rosenstein
1 min readOct 12, 2020

I was reconfiguring defaults for postgres configurations, when I got this error:

ERROR: 4 is outside the valid range for parameter “work_mem” (64 .. 2097151)

I thought that was pretty weird, since the default value is 4 and every guide and documentation all shows that you can even set kilobytes. SO why was I getting this error?

Turns out that I had made the very simple mistake of not specifying what type of value I wanted= I had to write 4MB instead of 4 . Changing this immediately resolved the issue.

--

--

Kobi Rosenstein

Linux infrastructure guy. This blog chronicles my “gotcha” moments — Each post contains an answer I would have like to have found when trawling google.