Create a function quote_nullable(), which works the same as quote_literal()
authorTom Lane <tgl@sss.pgh.pa.us>
Sun, 23 Mar 2008 00:24:20 +0000 (00:24 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Sun, 23 Mar 2008 00:24:20 +0000 (00:24 +0000)
commit7de81124d52422a513725af7f40446613e6bdda8
tree2716cf33b99552a4ca76bc97e010c7654ca15fe7
parent40a3dfb7e354787bc5da6bf0b62b5f11b1a86efb
Create a function quote_nullable(), which works the same as quote_literal()
except that it returns the string 'NULL', rather than a SQL null, when called
with a null argument.  This is often a much more useful behavior for
constructing dynamic queries.  Add more discussion to the documentation
about how to use these functions.

Brendan Jurd
doc/src/sgml/func.sgml
doc/src/sgml/plpgsql.sgml
src/backend/utils/adt/quote.c
src/include/catalog/catversion.h
src/include/catalog/pg_proc.h
src/include/utils/builtins.h