Specify Null values for the fields of a row type
The fields of a row-type column can contain NULL values. When you insert into or update a row-type field with a NULL value, you must cast the value to the data type of that field.
The
following UPDATE statement shows how you might specify NULL values
for particular fields of a named row-type column:
UPDATE employee
SET address = ROW(NULL::VARCHAR(20), 'Davis', 'CA',
ROW(NULL::CHAR(5), NULL::CHAR(4)))::address_t)
WHERE name = 'henry, john';
The following UPDATE
statement shows how you specify NULL values for the street and zip fields
of the address column for the student table.
UPDATE student
SET address = ROW(NULL::VARCHAR(20), address.city,
address.state, NULL::VARCHAR(9))
WHERE s_name = 'henry, john';
Important: You
cannot specify NULL values for a row-type column. You can only specify
NULL values for the individual fields of the row type.