Postgres foreign key with ON DELETE SET NULL for only some of its columns
Currently there is no way for the CASCADE action to set only some of the columns to NULL. So the only options I see would be:


have all the 4 columns defined as NULL and use ON DELETE SET NULL action. Seems like this is not an option in your case.
add another table to hold this relationship (where all the columns are not nullable) and use ON DELETE CASCADE.
a trigger.
create a procedure (function in Postgres) to handle deletions of table c. The function would first modify the columns (c,d) in table a and then delete from table c. Then you have to make sure that all users/applications use this function and do not directly delete from table c.