Thread: String manipulation in plpgsql

String manipulation in plpgsql

From
"Rod Kreisler"
Date:
Is there a way to do string manipulation in plpgsql, or should I just use plperl?  It's just been SO long since I've used perl, trying to avoid it....

Re: String manipulation in plpgsql

From
Joe Conway
Date:
Rod Kreisler wrote:
> Is there a way to do string manipulation in plpgsql, or should I just use
> plperl?  It's just been SO long since I've used perl, trying to avoid it....
>

You can use any of the existing string functions, string concatenation,
etc. See:

http://developer.postgresql.org/docs/postgres/functions-string.html
and
http://developer.postgresql.org/docs/postgres/plpgsql-statements.html

as a start. Anything complex is probably a lot easier in plperl (or
pltcl or plpython) though.

HTH,

Joe



Re: String manipulation in plpgsql

From
"Rod Kreisler"
Date:
OK, that's it, I'm not working for 32 hours straight ever again...

I didn't even think about sql functions.

Thanks

> -----Original Message-----
> From: pgsql-novice-owner@postgresql.org
> [mailto:pgsql-novice-owner@postgresql.org]On Behalf Of Joe Conway
> Sent: Saturday, March 08, 2003 7:24 PM
> To: Rod Kreisler
> Cc: pgsql-novice@postgresql.org
> Subject: Re: [NOVICE] String manipulation in plpgsql
>
>
> Rod Kreisler wrote:
> > Is there a way to do string manipulation in plpgsql, or should
> I just use
> > plperl?  It's just been SO long since I've used perl, trying to
> avoid it....
> >
>
> You can use any of the existing string functions, string concatenation,
> etc. See:
>
> http://developer.postgresql.org/docs/postgres/functions-string.html
> and
> http://developer.postgresql.org/docs/postgres/plpgsql-statements.html
>
> as a start. Anything complex is probably a lot easier in plperl (or
> pltcl or plpython) though.
>
> HTH,
>
> Joe
>
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Don't 'kill -9' the postmaster
>
>

Re: String manipulation in plpgsql

From
Tom Lane
Date:
"Rod Kreisler" <rod@23net.net> writes:
> Is there a way to do string manipulation in plpgsql, or should I just use
> plperl?  It's just been SO long since I've used perl, trying to avoid it....

plpgsql's string-handling functions are the same as SQL's, ie, pretty
primitive.  If you need to do anything more complex than simple
substring extraction, I'd think perl is the path of least resistance.
(pltcl and plpython are alternatives, too, if you like those languages
better than perl.)

            regards, tom lane