Re: BUG #17099: Problem with EXECUTE and JSON

From: Евгений Илюшин <ineron(at)icloud(dot)com>
To: ineron(at)icloud(dot)com, pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #17099: Problem with EXECUTE and JSON
Date: 2021-07-11 13:48:08
Message-ID: 8E14AA43-5F08-4DE3-A9B5-6C5BA55174B5@icloud.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

I figured it out, my mistake!
Sorry !!!

> 11 июля 2021 г., в 14:40, PG Bug reporting form <noreply(at)postgresql(dot)org> написал(а):
>
> The following bug has been logged on the website:
>
> Bug reference: 17099
> Logged by: Eugene Ilushin
> Email address: ineron(at)icloud(dot)com
> PostgreSQL version: 11.7
> Operating system: centos-release-7-6.1810.2.el7.centos.x86_64
> Description:
>
> DO $$
> DECLARE
> _res jsonb;
> BEGIN
> --EXECUTE
> $sql$select(json_build_object('name','name','query','query','params','params','type','type')->>'name')
> $sql$ into _res; -- do not work
> --EXECUTE ($sql$select ('{"name":"34534534"}'::jsonb)->>'name'$sql$) into
> _res; -- work
> EXECUTE ($sql$select ('{"name":"ewrewfsf"}'::jsonb)->>'name'$sql$) into
> _res; -- do not work
> raise notice '%',_res;
> END$$;
> Hi !
> Why i get an error if sends text but not error if send digits ?
> ERROR: invalid input syntax for type json
> DETAIL: Token "ewrewfsf" is invalid.
> CONTEXT: JSON data, line 1: ewrewfsf
> PL/pgSQL function inline_code_block line 7 at EXECUTE
> SQL state: 22P02
>

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2021-07-11 15:28:58 Re: BUG #17098: Assert failed on composing an error message when adding a type to an extension being dropped
Previous Message PG Bug reporting form 2021-07-11 12:40:36 BUG #17099: Problem with EXECUTE and JSON