pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
BUG #15716: pgadmin 4.3: row_to_json error
2+ messages / 2 participants
[nested] [flat]

* BUG #15716: pgadmin 4.3: row_to_json error
@ 2019-03-26 15:18 PG Bug reporting form <noreply@postgresql.org>
  2019-03-26 15:49 ` Re: BUG #15716: pgadmin 4.3: row_to_json error Anthony Sotolongo <asotolongo@gmail.com>
  0 siblings, 1 reply; 2+ messages in thread

From: PG Bug reporting form @ 2019-03-26 15:18 UTC (permalink / raw)
  To: pgsql-bugs@lists.postgresql.org; +Cc: jan.magnusson0@gmail.com

The following bug has been logged on the website:

Bug reference:      15716
Logged by:          Jan Magnusson
Email address:      jan.magnusson0@gmail.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"}



^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: BUG #15716: pgadmin 4.3: row_to_json error
  2019-03-26 15:18 BUG #15716: pgadmin 4.3: row_to_json error PG Bug reporting form <noreply@postgresql.org>
@ 2019-03-26 15:49 ` Anthony Sotolongo <asotolongo@gmail.com>
  0 siblings, 0 replies; 2+ messages in thread

From: Anthony Sotolongo @ 2019-03-26 15:49 UTC (permalink / raw)
  To: jan.magnusson0@gmail.com, pgsql-bugs@lists.postgresql.org, PG Bug reporting form <noreply@postgresql.org>

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.magnusson0@gmail.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"}
>




^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2019-03-26 15:49 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2019-03-26 15:18 BUG #15716: pgadmin 4.3: row_to_json error PG Bug reporting form <noreply@postgresql.org>
2019-03-26 15:49 ` Anthony Sotolongo <asotolongo@gmail.com>

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