pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Alvaro Herrera <alvherre@alvh.no-ip.org>
To: Amit Langote <amitlangote09@gmail.com>
Cc: Pg Hackers <pgsql-hackers@lists.postgresql.org>
Subject: strangely worded message
Date: Sat, 14 Dec 2024 13:43:46 +0100
Message-ID: <202412141243.efesjyyvzxsz@alvherre.pgsql> (raw)

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.  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.

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.

Thanks

-- 
Álvaro Herrera               48°01'N 7°57'E  —  https://www.EnterpriseDB.com/





view thread (3+ messages)  latest in thread

Message-ID: <202412141243.efesjyyvzxsz@alvherre.pgsql>
Permalink:  ../202412141243.efesjyyvzxsz@alvherre.pgsql/
Also on:    postgresql.org/message-id/202412141243.efesjyyvzxsz@alvherre.pgsql

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: alvherre@alvh.no-ip.org, amitlangote09@gmail.com, pgsql-hackers@lists.postgresql.org
  Subject: Re: strangely worded message
  In-Reply-To: <202412141243.efesjyyvzxsz@alvherre.pgsql>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox