Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1h8oKP-0004mq-Fe for pgsql-bugs@arkaria.postgresql.org; Tue, 26 Mar 2019 15:49:29 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1h8oKN-0001xz-Oe for pgsql-bugs@arkaria.postgresql.org; Tue, 26 Mar 2019 15:49:27 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1h8oKN-0001xs-CJ for pgsql-bugs@lists.postgresql.org; Tue, 26 Mar 2019 15:49:27 +0000 Received: from mail-qt1-x844.google.com ([2607:f8b0:4864:20::844]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1h8oKJ-0004iB-Kl for pgsql-bugs@lists.postgresql.org; Tue, 26 Mar 2019 15:49:25 +0000 Received: by mail-qt1-x844.google.com with SMTP id x12so15125808qts.7 for ; Tue, 26 Mar 2019 08:49:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-transfer-encoding:content-language; bh=xRksXkFQuUFF8qyZ3x6eyBmOr7z6j+bHBOyRMsVpPbw=; b=ZtFBK0AKytOVSZRxO7b0Og5hoVbPwhS+qi5aHFInNdDU5JntzX4hXh8dt4oPsxFdlW 7elfd891PAisRMOvRAKP7wHHQP7fHThmYGVAgK1243owHRTdXR1PWNXGZMFuHZKX1Hzx PIxdmo8Leic9jdZwXjG58jN5VBhVPWHupVM5bn3wsyGpZRtpRoECr/lQ6iwbMk92jBLK Tk3uClmV3fRjs1YgrNOcN8dv8k6Ui5deDGIvoCw+Da6jdEkeD9pbRg6V8NJeuVnjSwu3 tpZwvvOIXBedtEhNQKvVBu0TO3jQK0kSChUR4SpBvglpAqikwaIQLeB9j3J+KM3LBhw/ Rxvg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=xRksXkFQuUFF8qyZ3x6eyBmOr7z6j+bHBOyRMsVpPbw=; b=mpb8i164BJRDXJdW1MmVx18UeoKhrpmh5sOMWY9F5KjgIgxLwAP/BU1tc1FwwY5L+I l7awJ0BLbYU9TLMpnbzizHSq0zGAG1aeVgzy32KqYW2S0KqHvX5x/dbLDv7GK/lUd/98 8cGNXPWXZki5Ig2lgkT1cbzVuYg3LlFG8kFQQ7moVUXY6TQCkZVVHEHw2aCnzKhcgf9G QbZZjVksixyeObWZKYNwaToUfd9tCB6r8d04tZopC9c7cHwUDyZJJoHcFVs2uM+blGN4 puewiHR51A11UEYfkXXYXkVuPgZVUlVq1aSZ/F2PHM6OvzfCcRx4ouo0pr2orNrtFqx1 Ed6A== X-Gm-Message-State: APjAAAV3wn2hisDlRGz9+bJeVmuNs9EYFenh8sDBIPJZjNObOcyweRVR nYBIIz9c0bG3no/m1CNKUi0= X-Google-Smtp-Source: APXvYqy6BWXEDFfACXkWNslBgqD5+26EjUj+R4XcTB57aPIRYnaXYBUns/mM1zTE9UDXPIbz5BBQ8A== X-Received: by 2002:a0c:afb0:: with SMTP id s45mr11074819qvc.151.1553615362839; Tue, 26 Mar 2019 08:49:22 -0700 (PDT) Received: from [192.112.10.227] (as5300-s42-216.cnt.entelchile.net. [164.77.140.226]) by smtp.gmail.com with ESMTPSA id q75sm11507650qke.17.2019.03.26.08.49.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 26 Mar 2019 08:49:22 -0700 (PDT) Subject: Re: BUG #15716: pgadmin 4.3: row_to_json error To: jan.magnusson0@gmail.com, pgsql-bugs@lists.postgresql.org, PG Bug reporting form References: <15716-ecbe251902df182f@postgresql.org> From: Anthony Sotolongo Message-ID: <9721f146-6fde-71fd-e028-1edbff4cd177@gmail.com> Date: Tue, 26 Mar 2019 12:49:20 -0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.5.1 MIME-Version: 1.0 In-Reply-To: <15716-ecbe251902df182f@postgresql.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: es-ES List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk 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"} >