From 1c51c7d5ffd407426f314b2cd317ef77f14efb1f Mon Sep 17 00:00:00 2001 From: Peter Eisentraut Date: Tue, 22 Feb 2011 23:33:44 +0200 Subject: Add PL/Python functions for quoting strings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- src/pl/plpython/expected/plpython_test.out | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/pl/plpython/expected/plpython_test.out') diff --git a/src/pl/plpython/expected/plpython_test.out b/src/pl/plpython/expected/plpython_test.out index d92c9876ee..961f6c0d18 100644 --- a/src/pl/plpython/expected/plpython_test.out +++ b/src/pl/plpython/expected/plpython_test.out @@ -43,9 +43,9 @@ contents.sort() return ", ".join(contents) $$ LANGUAGE plpythonu; select module_contents(); - module_contents -------------------------------------------------------------------------------------------- - Error, Fatal, SPIError, debug, error, execute, fatal, info, log, notice, prepare, warning + module_contents +--------------------------------------------------------------------------------------------------------------------------------------- + Error, Fatal, SPIError, debug, error, execute, fatal, info, log, notice, prepare, quote_ident, quote_literal, quote_nullable, warning (1 row) CREATE FUNCTION elog_test() RETURNS void -- cgit v1.2.1