Re: strangely worded message

From: Amit Langote <amitlangote09(at)gmail(dot)com>
To: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
Cc: Pg Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: strangely worded message
Date: 2024-12-16 02:58:51
Message-ID: CA+HiwqFpWNFUf=Bc3UeEgu-SG9dPfO0Nz8MKFKbEkuwnn-+YTg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi Alvaro,

On Sat, Dec 14, 2024 at 9:43 PM Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org> wrote:
>
> Hello
>
> The following message introduced by commit 03734a7fed7d appears in two
> places:
>
> if (returning->typid != JSONOID && returning->typid != JSONBOID)
> ereport(ERROR,
> (errcode(ERRCODE_DATATYPE_MISMATCH),
> errmsg("cannot use RETURNING type %s in %s",
> format_type_be(returning->typid), fname),
> parser_errposition(pstate, output->typeName->location)));
>
> where fname is either JSON(), JSON_SCALAR(), JSON_SERIALIZE(). The
> wording seems a bit off to me.

Yeah, I agree.

> What about the following?
>
> ERROR: cannot use type %s in RETURNING clause of %s
> DETAIL: Only types json and jsonb are allowed in the RETURNING clause.

+1

> Other ideas I considered:
>
> ERROR: cannot use RETURNING %s in %s
> ERROR: cannot use "RETURNING %s" in %s
>
> DETAIL: The type can be json or jsonb in RETURNING.
> DETAIL: The RETURNING clause allows types json or jsonb.
> DETAIL: Types json and jsonb are allowed in RETURNING.

I think I'd go with the one you chose.

Are you planning to push a fix yourself or would you like me to?

--
Thanks, Amit Langote

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Andreas Karlsson 2024-12-16 03:35:50 Re: Precheck to consider path costs for partial paths
Previous Message Sutou Kouhei 2024-12-16 02:39:58 Re: confusing / inefficient "need_transcoding" handling in copy