Jeff Davis <pgsql@j-davis.com> writes:
> On Mon, 2006-11-06 at 16:40 -0800, Matthew Peter wrote:
>> v_value text := null;
>> -- ^^^ right here, NULL makes the querystring fail by setting cmd =
>> null
>> BEGIN
>> cmd := 'INSERT INTO test (
>> col
>> ) values ( '
>> || quote_literal(v_value) || ');';
>> EXECUTE cmd;
> Concatenation with NULL yields NULL, which is the correct behavior.
Hm. I wonder whether we should redefine quote_literal as a non-strict
function that delivers "NULL" (*without* any quotes) when fed a null
input. While that would do the Right Thing in this particular example,
I'm worried that it might do the wrong thing in other contexts...
Comments?
regards, tom lane