Received: from magus.postgresql.org (magus.postgresql.org [87.238.57.229]) by mail.postgresql.org (Postfix) with ESMTP id 5EC5012A65BB for ; Sat, 2 Jun 2012 14:05:49 -0300 (ADT) Received: from nm15.bullet.mail.sp2.yahoo.com ([98.139.91.85]) by magus.postgresql.org with smtp (Exim 4.72) (envelope-from ) id 1Sarlp-0005nM-Nk for pgsql-performance@postgresql.org; Sat, 02 Jun 2012 17:05:48 +0000 Received: from [72.30.22.93] by nm15.bullet.mail.sp2.yahoo.com with NNFMP; 02 Jun 2012 17:05:31 -0000 Received: from [98.139.91.15] by tm15.bullet.mail.sp2.yahoo.com with NNFMP; 02 Jun 2012 17:05:31 -0000 Received: from [127.0.0.1] by omp1015.mail.sp2.yahoo.com with NNFMP; 02 Jun 2012 17:05:31 -0000 X-Yahoo-Newman-Property: ymail-3 X-Yahoo-Newman-Id: 216493.64019.bm@omp1015.mail.sp2.yahoo.com Received: (qmail 11035 invoked by uid 60001); 2 Jun 2012 17:05:30 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1338656730; bh=n4ecpod8oo8a0tUeALB8LeM55FKZ4VOPNMizRlPZ+rU=; h=X-YMail-OSG:Received:X-Mailer:References:Message-ID:Date:From:Reply-To:Subject:To:In-Reply-To:MIME-Version:Content-Type; b=RJCkkhAiA31zISbIdO7sGgG1Mu10LVriQSagu743WfXOunEKKk+CjrrGQ6QoS3e1wXzOVQeBjM1b+1lS3xtxlj/yBPQ3TDfdKDMu2YhnfQNAVgjWezH0eGToOv6fDVSLq4ycRoaKNdlq+Bs3k55Q5S8aCkAVPRH4NKFF0pJA/YE= DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=X-YMail-OSG:Received:X-Mailer:References:Message-ID:Date:From:Reply-To:Subject:To:In-Reply-To:MIME-Version:Content-Type; b=36DM3ZbQmOeaMwMmDuIrbDJjxd2c5V7AdDUtaR4pcdNm1R0eV9h9RQZGbzv7aJJHkiza0nsL61kInj4fumWd0P6EA/LTp0AZW5DjpyyvTUTVmwbZiOvT7cP/+TQgwaEPa0c1/de0B+M4ZLYmWGzRv0eaBp7LJWbm8KqqHmb5hCk=; X-YMail-OSG: 9cdQpvMVM1l3PgMRZMeNSIoxNWOkx2ehk8n4o3x254Mt7aN nvDpFYjKElIhl0a4METmOP5DKHcyynQP2hTosp_mSnnVa5f0vvOw26FyyaBB 0.nI7j8ywDqS.sXgStQYFCVR73rMcTFt_gzzGlCs1g.FUMwrNk53TgEnpv5e wqMr_skmT1nG2Xa9NIUFNaYMwE5yhhJNYNJIL5fpa1Gai1ip634zfJIymY.D BKwWu1H1YF7pcG.kWny.TFGkO3T3_XIRm_CT5F2uPazlprE0GUfctNd6vIKX boTDMBJkzn0_8qqklzbay3uoviz3jyoKQD_QhKG5rsztvxad37VmNS8A9wSD jJvtb_Yiu_YDOQTVWlZX3KEYAzHVP.GlPAoXbdFnFbJfP1w91KFLzSw5VVME cbdqDGuWm9TuF3B1jW7LRTt8OXRET8We2l9aa3uY8dS2SA3ZBC5OmfKMbLLQ s Received: from [95.76.66.42] by web110416.mail.gq1.yahoo.com via HTTP; Sat, 02 Jun 2012 10:05:30 PDT X-Mailer: YahooMailWebService/0.8.118.349524 References: <4FC7F0DB.40600@atlassian.com> <4FC7F844.8070205@atlassian.com> <4FC80000.2000900@atlassian.com> <4FC8862B.70103@gmail.com> Message-ID: <1338656730.99764.YahooMailNeo@web110416.mail.gq1.yahoo.com> Date: Sat, 2 Jun 2012 10:05:30 -0700 (PDT) From: idc danny Reply-To: idc danny Subject: Array fundamentals To: "pgsql-performance@postgresql.org" In-Reply-To: <4FC8862B.70103@gmail.com> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="-613926479-685372254-1338656730=:99764" X-Pg-Spam-Score: -0.1 (/) X-Archive-Number: 201206/8 X-Sequence-Number: 47034 ---613926479-685372254-1338656730=:99764 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Hi all,=0AI got 2 complementary functions, which will do opposite things.= =0A1 - CombineStrings(stringarray character varying[])=A0 RETURNS character= varying=0AThis one will take as parameter an array of strings and will ret= urn a string with some formatted information inside=0A2-=A0=A0SplitString2A= rray(stringtosplit character varying)=A0 RETURNS character varying[]=A0=0AT= his one will take as parameter a formatted string and will return an array = of string=0A=0AThe following is true, both works just fine :=A0=0Aselect Sp= litString2Array(CombineStrings(ARRAY['abba', 'queen']))=0Awill return {'abb= a', 'queen'}=0A=0ANow, if I want do do the following:=0Aselect CombineStrin= gs(ARRAY[SplitString2Array("SomeTextColumn"), 'New string to add']) from "S= omeTable"=0A=0Ai get the following error:=0Aarray value must start with "{"= or dimension information=0A=0A=0AWhat am I doing wrong, I am feeling I sti= ll 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:=0AInsert into "Som= eTable"("SomeTextColumn") values (CombineString(ARRAY['abba', 'queen', 'New= string to add']))=0A=0AThank you in advance,=0ADanny=0A ---613926479-685372254-1338656730=:99764 Content-Type: text/html; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable
Hi al= l,
I got 2 complementary functions, which will do oppo= site things.
1 - CombineStrings(stringarr= ay character varying[])  RETURNS character varying
This one = will take as parameter an array of strings and will return a string with so= me formatted information inside
2-  SplitString2Array(s= tringtosplit character varying)  RETURNS character varying[] 
This one will take as parameter a formatted string and will return a= n array of string

The following is true, both work= s just fine : 
select SplitString2Array(CombineStrings(ARRAY['abba', 'queen']))
will r= eturn {'abba', 'queen'}

Now, if I want do do the f= ollowing:
select CombineStrings(ARRAY[SplitString2Array("SomeText= Column"), 'New string to add']) from "SomeTable"
i get the fo= llowing error:
array value must start with "{" or dimension infor= mation

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

Thank you in advance,=
Danny

---613926479-685372254-1338656730=:99764--