slightly misleading Error message in guc.c

Started by jian healmost 2 years ago5 messageshackers
Jump to latest
#1jian he
jian.universality@gmail.com

hi.
minor issue in guc.c.

set work_mem to '1kB';
ERROR: 1 kB is outside the valid range for parameter "work_mem" (64
.. 2147483647)
should it be
ERROR: 1 kB is outside the valid range for parameter "work_mem" (64
kB .. 2147483647 kB)
?
since the units for work_mem are { "B", "kB", "MB", "GB", and "TB"}

search `outside the valid range for parameter`,
there are two occurrences in guc.c.

#2Nazir Bilal Yavuz
byavuz81@gmail.com
In reply to: jian he (#1)
Re: slightly misleading Error message in guc.c

Hi,

On Mon, 22 Apr 2024 at 11:44, jian he <jian.universality@gmail.com> wrote:

hi.
minor issue in guc.c.

set work_mem to '1kB';
ERROR: 1 kB is outside the valid range for parameter "work_mem" (64
.. 2147483647)
should it be
ERROR: 1 kB is outside the valid range for parameter "work_mem" (64
kB .. 2147483647 kB)
?
since the units for work_mem are { "B", "kB", "MB", "GB", and "TB"}

search `outside the valid range for parameter`,
there are two occurrences in guc.c.

Nice find. I agree it could cause confusion.

--
Regards,
Nazir Bilal Yavuz
Microsoft

#3Tom Lane
tgl@sss.pgh.pa.us
In reply to: jian he (#1)
Re: slightly misleading Error message in guc.c

jian he <jian.universality@gmail.com> writes:

set work_mem to '1kB';
ERROR: 1 kB is outside the valid range for parameter "work_mem" (64
.. 2147483647)
should it be
ERROR: 1 kB is outside the valid range for parameter "work_mem" (64
kB .. 2147483647 kB)
?
since the units for work_mem are { "B", "kB", "MB", "GB", and "TB"}

Seems like a useful change ... about like this?

regards, tom lane

Attachments:

add-units-to-error-messages.patchtext/x-diff; charset=us-ascii; name=add-units-to-error-messages.patchDownload+21-11
#4Daniel Gustafsson
daniel@yesql.se
In reply to: Tom Lane (#3)
Re: slightly misleading Error message in guc.c

On 22 Apr 2024, at 18:04, Tom Lane <tgl@sss.pgh.pa.us> wrote:

Seems like a useful change

Agreed.

... about like this?

Patch LGTM.

--
Daniel Gustafsson

#5Tom Lane
tgl@sss.pgh.pa.us
In reply to: Daniel Gustafsson (#4)
Re: slightly misleading Error message in guc.c

Daniel Gustafsson <daniel@yesql.se> writes:

On 22 Apr 2024, at 18:04, Tom Lane <tgl@sss.pgh.pa.us> wrote:
Seems like a useful change

Agreed.

... about like this?

Patch LGTM.

Pushed.

regards, tom lane