quote text array

Поиск
Список
Период
Сортировка
От Laurent Buffat
Тема quote text array
Дата
Msg-id 290B018E-D49A-4203-B85A-6D1A2BAADF8B@altrabio.com
обсуждение исходный текст
Список 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



В списке pgsql-docs по дате отправления:

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: Backslash Escape Sequences
Следующее
От: James Robinson
Дата:
Сообщение: plpgsql, declare blocks, and '=' versus ':='