pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Anthony Sotolongo <asotolongo@gmail.com>
To: jan.magnusson0@gmail.com, pgsql-bugs@lists.postgresql.org, PG Bug reporting form <noreply@postgresql.org>
Subject: Re: BUG #15716: pgadmin 4.3: row_to_json error
Date: Tue, 26 Mar 2019 12:49:20 -0300
Message-ID: <9721f146-6fde-71fd-e028-1edbff4cd177@gmail.com> (raw)
In-Reply-To: <15716-ecbe251902df182f@postgresql.org>
References: <15716-ecbe251902df182f@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"}
>




view thread (2+ messages)

Message-ID: <9721f146-6fde-71fd-e028-1edbff4cd177@gmail.com>
Permalink:  ../9721f146-6fde-71fd-e028-1edbff4cd177@gmail.com/
Also on:    postgresql.org/message-id/9721f146-6fde-71fd-e028-1edbff4cd177@gmail.com

 · 

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: asotolongo@gmail.com, noreply@postgresql.org
  Subject: Re: BUG #15716: pgadmin 4.3: row_to_json error
  In-Reply-To: <9721f146-6fde-71fd-e028-1edbff4cd177@gmail.com>
  References: <15716-ecbe251902df182f@postgresql.org> <9721f146-6fde-71fd-e028-1edbff4cd177@gmail.com>

* 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