Re: Easier string concat in PL funcs? - Mailing list pgsql-general

From Alvaro Herrera
Subject Re: Easier string concat in PL funcs?
Date
Msg-id 20071003160459.GG10624@alvh.no-ip.org
Whole thread Raw
In response to Easier string concat in PL funcs?  (Jerry Sievers <jerry@jerrysievers.com>)
List pgsql-general
Jerry Sievers wrote:
> After for the umpteenth time bashing my head against a wall developing
> some PL funcs that use dynamic SQL, going plain bonkers trying to
> build the query string; I came up with a function like the one below
> to take a string with placeholders, an array of values to be
> interpolated and a placeholder char.  (This may appear Pythonish to
> some.
>
> Question: Am I overlooking a simple way of doing this?
>
> As in; raise notice 'Foo % %', v_var1, v_var2;

No, you aren't.  AFAICT there isn't any way to do that, and I missed it
not too long ago.

I'm not sure about the exact syntax, and certainly I expect this to
become less of an issue with plan invalidation on 8.3, but IMHO it would
be good to have something like Python %(f)s string interpolation (or
just plain string interpolation like in other languages).

--
Alvaro Herrera                        http://www.advogato.org/person/alvherre
"Cuando no hay humildad las personas se degradan" (A. Christie)

pgsql-general by date:

Previous
From: Jerry Sievers
Date:
Subject: Easier string concat in PL funcs?
Next
From: Laurent ROCHE
Date:
Subject: Generating TRUNCATE orders