View Single Post

   
  #4 (permalink)  
Old 04-09-2008, 11:04 PM
Merlin Moncure
 
Posts: n/a
Default Re: Easier string concat in PL funcs?

On 10/3/07, hubert depesz lubaczewski <depesz@depesz.com> wrote:
> On Wed, Oct 03, 2007 at 11:47:26AM -0400, Jerry Sievers wrote:
> > Question: Am I overlooking a simple way of doing this?

>
> yes. use plpython or plperl to do the job.
>
> depesz
>



here is a great example with pl/perl (search: printf)
http://people.planetpostgresql.org/g...ries/12-PlPerl

-- Parse a pipe-delimeted string:
SELECT sprintf('Total grams: %3.3f Donuts: %s',
'101.319472|chocolate and boston cream', '|');

sprintf
---------------------------------------------------------
Total grams: 101.319 Donuts: chocolate and boston cream

merlin

---------------------------(end of broadcast)---------------------------
TIP 4: Have you searched our list archives?

http://archives.postgresql.org/

Reply With Quote