Re: concat_ws - Mailing list pgsql-admin

From Tom Lane
Subject Re: concat_ws
Date
Msg-id 26941.1059926135@sss.pgh.pa.us
Whole thread Raw
In response to concat_ws  (Hans Spaans <pgsql-admin@lists.hansspaans.nl>)
Responses Re: concat_ws
List pgsql-admin
Hans Spaans <pgsql-admin@lists.hansspaans.nl> writes:
> Currently I'm working on porting a mysql-app to postgresql and they're
> using concat_ws[1], but I'm currently can't find anything like it in
> postgresql. Or did I overlooked something in the documentation?

There's nothing like that built-in, but you could duplicate the
functionality in five minutes with a user-defined function.

plperl or pltcl would probably be the best suited to whacking
strings around, but for a task as simple as this, plpgsql would
do fine too.

I think you'd need to generate a separate function definition for
each number of arguments you wanted to deal with, which is a bit
of a pain in the neck, but it still beats writing an extension
function in C ...

            regards, tom lane

pgsql-admin by date:

Previous
From: Gaetano Mendola
Date:
Subject: Re: concat_ws
Next
From: Joe Conway
Date:
Subject: Re: concat_ws