pgsql: Add PL/Python functions for quoting strings

Started by Peter Eisentrautover 15 years ago1 messagescomitters
Jump to latest
#1Peter Eisentraut
peter_e@gmx.net

Add PL/Python functions for quoting strings

Add functions plpy.quote_ident, plpy.quote_literal,
plpy.quote_nullable, which wrap the equivalent SQL functions.

To be able to propagate char * constness properly, make the argument
of quote_literal_cstr() const char *. This also makes it more
consistent with quote_identifier().

Jan Urbański, reviewed by Hitoshi Harada, some refinements by Peter
Eisentraut

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/1c51c7d5ffd407426f314b2cd317ef77f14efb1f

Modified Files
--------------
doc/src/sgml/plpython.sgml | 17 +++++++
src/backend/utils/adt/quote.c | 6 +-
src/include/utils/builtins.h | 2 +-
src/pl/plpython/Makefile | 1 +
src/pl/plpython/expected/plpython_quote.out | 56 +++++++++++++++++++++++
src/pl/plpython/expected/plpython_test.out | 6 +-
src/pl/plpython/plpython.c | 65 +++++++++++++++++++++++++++
src/pl/plpython/sql/plpython_quote.sql | 33 ++++++++++++++
8 files changed, 179 insertions(+), 7 deletions(-)