1 -- test quoting functions
2 CREATE FUNCTION quote(t text, how text) RETURNS text AS $$
4 return plpy.quote_literal(t)
5 elif how == "nullable":
6 return plpy.quote_nullable(t)
8 return plpy.quote_ident(t)
10 raise plpy.Error("unrecognized quote type %s" % how)
11 $$ LANGUAGE plpythonu;
12 SELECT quote(t, 'literal') FROM (VALUES
29 SELECT quote(t, 'nullable') FROM (VALUES
46 SELECT quote(t, 'ident') FROM (VALUES
49 ('a " ''abc''')) AS v(t);