From: Laurenz Albe <laurenz.albe@cybertec.at>
To: bajinsheng@u.nus.edu
To: pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #18222: Unexpected Error--Cannot delete from scalar
Date: Mon, 04 Dec 2023 14:50:16 +0100
Message-ID: <e4e500f6f4f423de9df3e99680cd551c6253ae0c.camel@cybertec.at> (raw)
In-Reply-To: <18222-de86a89e6ed68f3d@postgresql.org>
References: <18222-de86a89e6ed68f3d@postgresql.org>
On Mon, 2023-12-04 at 05:56 +0000, PG Bug reporting form wrote:
> PostgreSQL version: 16.1
>
> SELECT ('1'-to_hex(2))::BOOLEAN; -- ERROR: cannot delete from scalar
>
> This error looks strange to me as I do not understand what this error
> means.
>
> If I execute the following query, there is no error instead:
> SELECT '1'-2; -- {-2}
That's not a bug.
PostgreSQL infers the operator jsonb - text. '1' gives a valid "jsonb"
scalar, but you cannot remove an attribute from a JSON scalar.
I cannot tell you what to do, because your expression makes as little
sense to me as it does to PostgreSQL.
Yours,
Laurenz Albe
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-bugs@postgresql.org
Cc: laurenz.albe@cybertec.at, bajinsheng@u.nus.edu, pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #18222: Unexpected Error--Cannot delete from scalar
In-Reply-To: <e4e500f6f4f423de9df3e99680cd551c6253ae0c.camel@cybertec.at>
* 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