Nevermind. Apparently from the psql command line the string NULL is
interpreted correctly as a NULL value, but from the DBI interface I'm
using, it is not translated correctly as a NULL value, but rather the
string 'NULL'.
I'll try using UNDEF instead.