# Edit roles errors

**URL:** <https://www.ruby-forum.com/t/edit-roles-errors/89676>\
**Category:** Engines\
**Created:** [March 29, 2006, 1:50am UTC](https://www.ruby-forum.com/t/edit-roles-errors/89676 "2006-03-29T01:50:17Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![wolfmanjm](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/3da27b/32.png) [@wolfmanjm](https://www.ruby-forum.com/u/wolfmanjm)\
**Post date:** [March 29, 2006, 1:50am UTC](https://www.ruby-forum.com/t/edit-roles-errors/89676/1 "2006-03-29T01:50:17Z")

</div>

When I try to add a new role I get the attached error. The problem is  
that postgresql doesn’t like the NULL being passed in for the two non  
null columnds omnipotent and system\_role, even though they have a  
default set to false, this is overriden by the INSERT SQL statement  
explicitly setting those columns to NULL.

The work around I have used is to simply add two checkboxes for those  
fields…

Omnipotent  
\<%= check\_box 'role', 'omnipotent' %\>

System Role  
\<%= check\_box 'role', 'system\_role' %\>

to the app/views/role/new.rhtml

the error I get when I try to create the new role was…

PGError: ERROR: ExecInsert: Fail to add null value in not null  
attribute omnipotent  
: INSERT INTO roles (“name”, “omnipotent”, “description”, “system\_role”)  
VALUES(‘Exec’, NULL, ‘Executive’, NULL)
