Adam Witney <awitney(at)sghms(dot)ac(dot)uk> writes:
> Is it possible to pass a null value into a PL/pgSQL function.
Certainly.
Your problem is with the EXECUTE, or even more specifically with the
string concatenation expression you're using to build the EXECUTE
expression. Do you really need an EXECUTE here at all? If so,
something involving COALESCE would work. I'd try
EXECUTE ''INSERT ....'' || coalesce(quote_literal(_name), ''NULL'') || '')'';
regards, tom lane