UPDATE pg_attribute SET attnotnull = TRUE WHERE attname = 'my_column' AND attrelid = (SELECT oid FROM pg_class WHERE relname = 'my_table')