Array fundamentals

Поиск
Список
Период
Сортировка
От idc danny
Тема Array fundamentals
Дата
Msg-id 1338656730.99764.YahooMailNeo@web110416.mail.gq1.yahoo.com
обсуждение исходный текст
Ответ на Re: Trouble with plan statistics for behaviour for query.  (Vitalii Tymchyshyn <tivv00@gmail.com>)
Ответы Re: Array fundamentals  (Robert Haas <robertmhaas@gmail.com>)
Список pgsql-performance
Hi all,
I got 2 complementary functions, which will do opposite things.
1 - CombineStrings(stringarray character varying[])  RETURNS character varying
This one will take as parameter an array of strings and will return a string with some formatted information inside
2-  SplitString2Array(stringtosplit character varying)  RETURNS character varying[] 
This one will take as parameter a formatted string and will return an array of string

The following is true, both works just fine : 
select SplitString2Array(CombineStrings(ARRAY['abba', 'queen']))
will return {'abba', 'queen'}

Now, if I want do do the following:
select CombineStrings(ARRAY[SplitString2Array("SomeTextColumn"), 'New string to add']) from "SomeTable"
i get the following error:
array value must start with "{" or dimension information

What am I doing wrong, I am feeling I still don't get the array fundamentals. My goal is to add to inside formatted information in the column "SomeTextColumn" my new string 'New string to add' in the same manner if I would been used the following:
Insert into "SomeTable"("SomeTextColumn") values (CombineString(ARRAY['abba', 'queen', 'New string to add']))

Thank you in advance,
Danny

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

Предыдущее
От: "Kevin Grittner"
Дата:
Сообщение: Re: High load average in 64-core server , no I/O wait and CPU is idle
Следующее
От: Alejandro Carrillo
Дата:
Сообщение: Re: Recover rows deleted