pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Hans Spaans <pgsql-admin@lists.hansspaans.nl>
Cc: pgsql-admin@postgresql.org
Subject: Re: concat_ws
Date: Sun, 03 Aug 2003 11:55:35 -0400
Message-ID: <26941.1059926135@sss.pgh.pa.us> (raw)
In-Reply-To: <20030803131931.GD4326@sch01r01.nexit.nl>
References: <20030803131931.GD4326@sch01r01.nexit.nl>

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



view thread (15+ messages)  latest in thread

Message-ID: <26941.1059926135@sss.pgh.pa.us>
Permalink:  ../26941.1059926135@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/26941.1059926135@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-admin@postgresql.org
  Cc: tgl@sss.pgh.pa.us, pgsql-admin@lists.hansspaans.nl
  Subject: Re: concat_ws
  In-Reply-To: <26941.1059926135@sss.pgh.pa.us>
  References: <20030803131931.GD4326@sch01r01.nexit.nl> <26941.1059926135@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox