Re: Internal error codes triggered by tests - Mailing list pgsql-hackers

From Michael Paquier
Subject Re: Internal error codes triggered by tests
Date
Msg-id ZpjEYLeMzy3QIjrG@paquier.xyz
Whole thread Raw
In response to Re: Internal error codes triggered by tests  (Daniel Gustafsson <daniel@yesql.se>)
Responses Re: Internal error codes triggered by tests
List pgsql-hackers
On Fri, Jul 12, 2024 at 10:41:14PM +0200, Daniel Gustafsson wrote:
> Mapping this case to ERRCODE_NAME_TOO_LONG seems like a legit improvement, even
> though the error is likely to be quite rare in production.

Hmm.  This is interesting, still it could be confusing as
ERRCODE_NAME_TOO_LONG is used only for names, when they are longer
than NAMEDATALEN, so in context that's a bit different than a longer
file name.

How about using a new error code in class 58, say a
ERRCODE_FILE_NAME_TOO_LONG like in the attached?
ERRCODE_DUPLICATE_FILE is like that; it exists just for the mapping
with EEXIST.
--
Michael

Attachment

pgsql-hackers by date:

Previous
From: Nitin Jadhav
Date:
Subject: Re: Inconsistency in reporting checkpointer stats
Next
From: Daniel Gustafsson
Date:
Subject: Re: Internal error codes triggered by tests