NULL values into PG table

I am using a Postgres node to insert data into tables. Some of the columns in these tables allow for NULLs. It seems that the current PG lib does not allow this by default.

I have fixed the issues for charter type columns, by doing something like this: {{$node["Merge"].json["quantity_received"] === null ? 'null' : $node["Merge"].json["quantity_received"]}}

This works for string values (not sure if this is the best approach though??), but timestamp value still fail during insert, when doing this: $${{$node["Map Keys WAYBILLS"].json["date_scheduled"] === null ? 'null' : $node["Map Keys WAYBILLS"].json["date_scheduled"].toISOString()}}$$.

Any ideas?

I have implemented the following to get past this issue:

A Function Item node before the Postgres node, where I do this for every nullable date: item.date_scheduled = item.date_scheduled === null ? '' : item.date_scheduled;.

Then inside the Postgres node, I add this to the relevant columns: NULLIF($${{$node["FunctionItem"].json["date_scheduled"]}}$$,'')::DATE.

Would this be the best approach?