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 1hc9ZF-0008Kc-W0 for pgsql-general@arkaria.postgresql.org; Sat, 15 Jun 2019 14:22:06 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hc9ZE-0004JU-Sj for pgsql-general@arkaria.postgresql.org; Sat, 15 Jun 2019 14:22:04 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hc9ZE-0004JN-JX for pgsql-general@lists.postgresql.org; Sat, 15 Jun 2019 14:22:04 +0000 Received: from stw1.rcdrun.com ([217.170.207.13]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hc9ZC-00036d-E8 for pgsql-general@lists.postgresql.org; Sat, 15 Jun 2019 14:22:04 +0000 Received: from protected.rcdrun.com (localhost [::1]) (AUTH: PLAIN admin, TLS: TLS1.2,256bits,ECDHE_RSA_AES_256_GCM_SHA384) by stw1.rcdrun.com with ESMTPSA; Sat, 15 Jun 2019 07:22:01 -0700 id 000000000005DD38.000000005D04FF09.00003B2E Received: from localhost (protected.rcdrun.com [local]) by protected.rcdrun.com (OpenSMTPD) with ESMTPA id bd25066a; Sat, 15 Jun 2019 14:22:00 +0000 (UTC) Date: Sat, 15 Jun 2019 16:22:00 +0200 From: Jean Louis To: Thomas Kellerer Cc: pgsql-general@lists.postgresql.org Subject: Re: how to concat/concat_ws all fields without braces Message-ID: <20190615142200.GK10179@protected.rcdrun.com> References: <20190615061957.GD2565@protected.rcdrun.com> <1d492f68-96d7-5062-49b4-227b2fdaf617@gmx.net> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline In-Reply-To: <1d492f68-96d7-5062-49b4-227b2fdaf617@gmx.net> Organization: START YOUR OWN GOLD MINE User-Agent: Mutt/1.10.1 (2018-07-13) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Dear Thomas, * Thomas Kellerer [2019-06-15 11:37]: > Jean Louis schrieb am 15.06.2019 um 13:19: > > I have tried doing something like: > > > > SELECT concat_ws(' ', table.*) FROM table; > > > > and if I do that way, it is essentially same as > > > > SELECT concat(table.*) FROM table; > > > > and I get the items in braces like (1,something). > > > > Why do I get it in braces? > > > > Is there a way without specifying specific fields > > to get all items concatenated without braces? > > > > I would prefer conat_ws option. > > you can use the json functions for that: > > select (select string_agg(x.v, ',') from jsonb_each_text(to_jsonb(t)) as x(k,v)) as all_columns > from the_table t; Danke, that works well. I did not know it works through Jansson exports. I hope it is fast enough. Jean