Re: BUG #18222: Unexpected Error--Cannot delete from scalar - Mailing list pgsql-bugs

From Laurenz Albe
Subject Re: BUG #18222: Unexpected Error--Cannot delete from scalar
Date
Msg-id e4e500f6f4f423de9df3e99680cd551c6253ae0c.camel@cybertec.at
Whole thread Raw
In response to BUG #18222: Unexpected Error--Cannot delete from scalar  (PG Bug reporting form <noreply@postgresql.org>)
List pgsql-bugs
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



pgsql-bugs by date:

Previous
From: PG Bug reporting form
Date:
Subject: BUG #18225: chdb's s3 table function crashes postgresql with plpython3
Next
From: Tom Lane
Date:
Subject: Re: BUG #18224: message bug in libpqwalreceiver.c.