[WISHLIST] EXECUTE SPRINTF - Mailing list pgsql-general

From Vincenzo Romano
Subject [WISHLIST] EXECUTE SPRINTF
Date
Msg-id AANLkTim0rldSdOdYArC-lDAOfmPMYiI23M-RhtOFT_vu@mail.gmail.com
Whole thread Raw
Responses Re: [WISHLIST] EXECUTE SPRINTF  (Pavel Stehule <pavel.stehule@gmail.com>)
List pgsql-general
Hi all.
I'd like to add an item to the PG wishlist (provided that one exists).
In PL/PgSQL function bodies I'm using very often a pattern like this:

EXECUTE SPRINTF( '...',... );

Where SPRINFT comes from here:
http://wiki.postgresql.org/wiki/Sprintf

It's by far more powerful, easy and effective than the standard
"string concatenation" mechanism available for the plain EXECUTE.
It's a different approach than the EXECUTE ... USING which has it's
own rules and limitations (see chapter 38.5.4 for v8.4.4).
The proposed approach doesn't know anything about symbols or other PL/PGSQL
related syntax and can be used to build very complex (or otherwise
impossible) dynamic SQL.

I'd like to either see the SPRINTF function embedded either into the
language, possibly with really variadic argument list (like stdarg.h
in C) or into the EXECUTE itself with something like "EXECUTE <a
string> SPRINTF <argument list>".

Does this make any sense to you all?

--
Vincenzo Romano
NotOrAnd Information Technologies
NON QVIETIS MARIBVS NAVTA PERITVS

pgsql-general by date:

Previous
From: "A. Kretschmer"
Date:
Subject: Re: resource management, letting user A use no more than X resource (time, CPU, memory...)
Next
From: "Wappler, Robert"
Date:
Subject: Planner decisions