Received: from localhost (unknown [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id B19332E37B2 for ; Sun, 23 Dec 2007 17:45:16 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 19871-05-6 for ; Sun, 23 Dec 2007 17:45:07 -0400 (AST) Received: from fk-out-0910.google.com (fk-out-0910.google.com [209.85.128.189]) by postgresql.org (Postfix) with ESMTP id 4E0A32E374F for ; Sun, 23 Dec 2007 17:45:03 -0400 (AST) Received: by fk-out-0910.google.com with SMTP id b27so1686878fka.3 for ; Sun, 23 Dec 2007 13:45:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; bh=6AlkavHAKXwbfv1ccuMgt2jrfPan1Luql3ge/FaXxaI=; b=MCvJvafqImAxDAr3jH/vpKb+XSEpGyTU9761TO7zm722Xg/rft9UzuuF9/yYatJwxeCBPwq+z8ivJyxsN4loXh+8TVoQteYByIwXY7PiCPumMaGyb3KGnmB/iW8YJ9DTQiNwlEPcLoUDvnhUx8761eKul3OM5XN8r9hrp/79XEI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=lKyZG6FuB6bASV0ZZmQr3rvavlqgK5qG/AhsfCoeYaFcZzOOtCxTExyuftq+9JbZjMdkrsxXswz8+iyiynrN5vvcYz/eADTZ4gHD3s0S2ULzdYfqMKdRYhUtshZZkrjijKC78nV+X/dvJR8iaH8vpE17v+RzwnSWju/EDsFgjsI= Received: by 10.78.175.14 with SMTP id x14mr1349663hue.7.1198446301870; Sun, 23 Dec 2007 13:45:01 -0800 (PST) Received: by 10.78.35.10 with HTTP; Sun, 23 Dec 2007 13:45:01 -0800 (PST) Message-ID: <162867790712231345w7c01493fv90517ba2dc9a90ff@mail.gmail.com> Date: Sun, 23 Dec 2007 22:45:01 +0100 From: "Pavel Stehule" To: pgsql-sql@postgresql.org Subject: Re: returning an array as a list fo single-column rows? In-Reply-To: <20071223213345.GA15623@apartia.fr> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <20071223205557.GA14403@apartia.fr> <162867790712231327g774b8c5ld488113a3a8252e9@mail.gmail.com> <20071223213345.GA15623@apartia.fr> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200712/124 X-Sequence-Number: 29816 > > Yes I thought about it, but would rather have Pg do the array splitting. > For instance if the separator occurs in an array element there is no > built-in escaping: > > % select array_to_string(array['ee','dd','rr','f|f'],'|'); > array_to_string > ----------------- > ee|dd|rr|f|f if you have not some special char, then unpack is one possible solution theoretically you can use text output postgres=# select array['aa','aaa,j']::text; array ----------------- {aa,"aaa,j"} (1 row) but nothing nice parse it :(