PostgreSQL calling function with a null parameter

You can also update the function to default to a value if null is supplied to allow for optional parameters.

CREATE OR REPLACE FUNCTION MyTable_UPDATE 
(
   _ID int,
   _Description text default null
) 
...

From postgresql documentation on CREATE FUNCTION

STRICT

RETURNS NULL ON NULL INPUT or STRICT indicates that the function always returns null whenever any of its arguments are null. If this parameter is specified, the function is not executed when there are null arguments; instead a null result is assumed automatically.

In short, the function is not executed.

You have to remove the STRICT parameter to be able to pass a NULL value.

Tags:

Postgresql