Some doubious error messages and comments

From: Kyotaro Horiguchi <horikyota(dot)ntt(at)gmail(dot)com>
To: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Some doubious error messages and comments
Date: 2021-04-28 08:36:33
Message-ID: 20210428.173633.1525059946206239295.horikyota.ntt@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hello.

0001: I found some typos in a error message and a comment.

multirangetypes.c: 1420
> errmsg("range_intersect_agg must be called with a multirange")));

This "range_intersect_agg" looks like a typo of "multirange_..".

operatorcmds.c:303
> * Look up a join estimator function ny name, and verify that it has the

"ny" looks like a typo of "by".

0002: The following messages are substantially same and are uselessly
split into separate messages. I'm not sure any compiler complains
about using %zu for int, explicit casting would work in that case.

be-secure-gssapi.c:351
> (errmsg("oversize GSSAPI packet sent by the client (%zu > %zu)",
> (size_t) input.length,
> PQ_GSS_RECV_BUFFER_SIZE - sizeof(uint32))));
be-secure-gssapi.c:570
> (errmsg("oversize GSSAPI packet sent by the client (%zu > %d)",
> (size_t) input.length,
> PQ_GSS_RECV_BUFFER_SIZE)));

0003: The messages below seems to be a bit unclear. I'm not sure they
worth doing.

conversioncmds.c: 130
errmsg("encoding conversion function %s returned incorrect result for empty input",

This is not wrong at all, but another message just above is saying
that "encoding conversion function %s must return type %s". Why
aren't we explicit here, like this?

"encoding conversion function %s must return zero for empty input"

typecmds.c:4294
> if (requireSuper)
> if (!superuser())
> ereport(ERROR,
> errmsg("must be superuser to alter a type")));

Where, requireSuper varies depending on the set of operations but the
description looks like describing general behavior. I'm not sure but
something like the following might be better?

+ errmsg("must be superuser to perform all operations")));
+ errmsg("some of the operations require superuser privilege")));

Any opinions or suggestions?

regards.

--
Kyotaro Horiguchi
NTT Open Source Software Center

Attachment Content-Type Size
0001-Fix-typos.patch text/x-patch 1.5 KB
0002-Consolidate-substantially-same-messages.patch text/x-patch 946 bytes
0003-Clarify-merror-messages.patch text/x-patch 1.4 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Aleksander Alekseev 2021-04-28 08:40:27 Re: Better sanity checking for message length words
Previous Message David Rowley 2021-04-28 08:24:17 Re: Result Cache node shows per-worker info even for workers not launched