Re: BUG #15716: pgadmin 4.3: row_to_json error

From: Anthony Sotolongo <asotolongo(at)gmail(dot)com>
To: jan(dot)magnusson0(at)gmail(dot)com, pgsql-bugs(at)lists(dot)postgresql(dot)org, PG Bug reporting form <noreply(at)postgresql(dot)org>
Subject: Re: BUG #15716: pgadmin 4.3: row_to_json error
Date: 2019-03-26 15:49:20
Message-ID: 9721f146-6fde-71fd-e028-1edbff4cd177@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

hi,

I think your mistake is in the order of the insert clause

use: insert in the values ​​of testing.batch (1,0, 0, now ());
instead:insert into testing.batch values(1, now(), 0, 0);

can you test with this order?

i test and function well

postgres=# CREATE SCHEMA testing AUTHORIZATION postgres;
CREATE SCHEMA
postgres=# CREATE TABLE testing.batch
postgres-# (
postgres(#     batch_id integer NOT NULL,
postgres(#     max_record integer,
postgres(#     record_count integer,
postgres(#     creation_ts timestamp without time zone DEFAULT now(),
postgres(#     CONSTRAINT batch_id_pkey PRIMARY KEY (batch_id)
postgres(# )
postgres-# WITH (
postgres(#     OIDS = FALSE
postgres(# )
postgres-# TABLESPACE pg_default;
CREATE TABLE
postgres=# insert into testing.batch values(1,0 ,  0,now());
INSERT 0 1
postgres=# insert into testing.batch values(2, 1, 1, now());
INSERT 0 1
postgres=# select row_to_json(row(batch_id)) from testing.batch;
 row_to_json
-------------
 {"f1":1}
 {"f1":2}
(2 filas)

postgres=# select row_to_json(b)
postgres-# from (select * from testing.batch) b;
row_to_json
-------------------------------------------------------------------------------------------
 {"batch_id":1,"max_record":0,"record_count":0,"creation_ts":"2019-03-26T12:45:42.598815"}
 {"batch_id":2,"max_record":1,"record_count":1,"creation_ts":"2019-03-26T12:45:43.885679"}
(2 filas)

postgres=# select version();
version
---------------------------------------------------------------------------------------------------------------------------------------------
 PostgreSQL 11.2 (Ubuntu 11.2-1.pgdg16.04+1) on x86_64-pc-linux-gnu,
compiled by gcc (Ubuntu 5.4.0-6ubuntu1~16.04.11) 5.4.0 20160609, 64-bit
(1 fila)

postgres=#

regards

El 26-03-19 a las 12:18, PG Bug reporting form escribió:
> The following bug has been logged on the website:
>
> Bug reference: 15716
> Logged by: Jan Magnusson
> Email address: jan(dot)magnusson0(at)gmail(dot)com
> PostgreSQL version: 11.2
> Operating system: windows 10 pro
> Description:
>
> The row_to_json() function does not produce any output data, only message.
>
> b.r. Jan
> ------------------------------------------------------------------------------------
> CREATE SCHEMA testing AUTHORIZATION postgres;
>
> CREATE TABLE testing.batch
> (
> batch_id integer NOT NULL,
> max_record integer,
> record_count integer,
> creation_ts timestamp without time zone DEFAULT now(),
> CONSTRAINT batch_id_pkey PRIMARY KEY (batch_id)
> )
> WITH (
> OIDS = FALSE
> )
> TABLESPACE pg_default;
>
>
> insert into testing.batch values(1, now(), 0, 0);
> insert into testing.batch values(2, now(), 1, 1);
>
> select row_to_json(row(batch_id)) from testing.batch;
>
> or
>
> select row_to_json(b)
> from (select * from testing.batch) b;
>
> They only produce the following message, but no output:
>
> Successfully run. Total query runtime: 70 msec.
> 2 rows affected.
>
> Other client output of the latter:
>
> {"batch_id":1,"max_record":0,"record_count":0,"creation_ts":"2019-03-26T16:44:34.338218"}
> {"batch_id":2,"max_record":1,"record_count":1,"creation_ts":"2019-03-26T16:51:33.196218"}
>

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2019-03-26 17:03:17 Re: BUG #15715: UPDATE using "in (subquery for update limit 1)" does not respect the limit in subquery
Previous Message PG Bug reporting form 2019-03-26 15:18:07 BUG #15716: pgadmin 4.3: row_to_json error