Received: from localhost (unknown [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id D14666509C3 for ; Wed, 9 Jul 2008 15:17:16 -0300 (ADT) Received: from postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 44516-01-5 for ; Wed, 9 Jul 2008 15:17:07 -0300 (ADT) X-Greylist: delayed 00:28:59.773106 by SQLgrey-1.7.6 Received: from pilet.ens-lyon.fr (pilet.ens-lyon.fr [140.77.167.16]) by postgresql.org (Postfix) with ESMTP id 917556508A0 for ; Wed, 9 Jul 2008 15:15:21 -0300 (ADT) Received: from localhost (localhost [127.0.0.1]) by pilet.ens-lyon.fr (Postfix) with ESMTP id B0DF615B6E0 for ; Wed, 9 Jul 2008 19:46:18 +0200 (CEST) Received: from pilet.ens-lyon.fr ([127.0.0.1]) by localhost (pilet [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 04965-41 for ; Wed, 9 Jul 2008 19:46:18 +0200 (CEST) Received: from [192.168.1.203] (unknown [140.77.34.213]) by pilet.ens-lyon.fr (Postfix) with ESMTP id 024C015B67E for ; Wed, 9 Jul 2008 19:46:17 +0200 (CEST) Message-Id: <290B018E-D49A-4203-B85A-6D1A2BAADF8B@altrabio.com> From: Laurent Buffat To: pgsql-docs@postgresql.org Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v924) Subject: quote text array Date: Wed, 9 Jul 2008 19:46:17 +0200 X-Mailer: Apple Mail (2.924) X-Virus-Scanned: by amavisd-new-20030616-p10 (Debian) at ens-lyon.fr X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests=none X-Spam-Level: X-Archive-Number: 200807/1 X-Sequence-Number: 4932 Hi, I would like to know how to allways quote all the string in the result of a select for a text array ? Here is some code : CREATE TABLE textarray ( name text[] ); INSERT INTO textarray VALUES ( '{ab,cd}'); INSERT INTO textarray VALUES ( '{a''b,cd}'); INSERT INTO textarray VALUES ( '{"a,b",cd}'); INSERT INTO textarray VALUES( array['a"b','cd']); SELECT * FROM textarray; name ------------ {ab,cd} {a'b,cd} {"a,b",cd} {"a\"b",cd} (4 rows) For the two last row, the first string is double quote. Is-it possible to have alway these double quote for all the string the result ? like this : (it's a artificial result) name ------------ {"ab","cd"} {"a'b","cd"} {"a,b","cd"} {"a\"b","cd"} (4 rows) Thanks for your help. Laurent