pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: PG Bug reporting form <noreply@postgresql.org>
To: pgsql-bugs@lists.postgresql.org
Cc: ineron@icloud.com
Subject: BUG #17099: Problem with EXECUTE and JSON
Date: Sun, 11 Jul 2021 12:40:36 +0000
Message-ID: <17099-7b756eb97b8e9e7a@postgresql.org> (raw)

The following bug has been logged on the website:

Bug reference:      17099
Logged by:          Eugene Ilushin
Email address:      ineron@icloud.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



view thread (3+ messages)  latest in thread

Message-ID: <17099-7b756eb97b8e9e7a@postgresql.org>
Permalink:  ../17099-7b756eb97b8e9e7a@postgresql.org/
Also on:    postgresql.org/message-id/17099-7b756eb97b8e9e7a@postgresql.org

 · 

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-bugs@postgresql.org
  Cc: noreply@postgresql.org, pgsql-bugs@lists.postgresql.org, ineron@icloud.com
  Subject: Re: BUG #17099: Problem with EXECUTE and JSON
  In-Reply-To: <17099-7b756eb97b8e9e7a@postgresql.org>

* 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