Re: Easier string concat in PL funcs?

From: "Merlin Moncure" <mmoncure(at)gmail(dot)com>
To: depesz(at)depesz(dot)com
Cc: "Jerry Sievers" <jerry(at)jerrysievers(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: Easier string concat in PL funcs?
Date: 2007-10-04 01:48:38
Message-ID: b42b73150710031848k5a14584bm2f2b6ceab1a73d9d@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 10/3/07, hubert depesz lubaczewski <depesz(at)depesz(dot)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/greg/index.php?/categories/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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Goboxe 2007-10-04 04:31:43 Re: Partitioned table limitation
Previous Message Andreas Strasser 2007-10-04 01:07:17 Design Question (Time Series Data)