From: | Laurent Buffat <laurent(dot)buffat(at)altrabio(dot)com> |
---|---|
To: | pgsql-docs(at)postgresql(dot)org |
Subject: | quote text array |
Date: | 2008-07-09 17:46:17 |
Message-ID: | 290B018E-D49A-4203-B85A-6D1A2BAADF8B@altrabio.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-docs |
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
From | Date | Subject | |
---|---|---|---|
Next Message | James Robinson | 2008-07-11 16:25:35 | plpgsql, declare blocks, and '=' versus ':=' |
Previous Message | Bruce Momjian | 2008-06-26 22:25:24 | Re: Backslash Escape Sequences |