rein icon indicating copy to clipboard operation
rein copied to clipboard

add_presence_constraint breaks when data type of column is jsonb

Open kelvintyb opened this issue 8 years ago • 1 comments

Encountered this bug when using rein to add a presence constraint on a column that is using the data type jsonb. Screenshot of the error message is as follows:

image 2017-10-26 at 11 31 34 am

From looking at the source code, I believe the issue stems from the method below where there is a comparison of the column with a regex matcher checking for whitespace string characters which results in a type casting error.

image 2017-10-26 at 11 36 28 am

kelvintyb avatar Oct 26 '17 03:10 kelvintyb

Thanks @kelvintyb, maybe it doesn't make sense to add a presence constraint to a JSONB column. Apart from checking it's not null, how would you verify it is "present"?

nullobject avatar Feb 16 '18 01:02 nullobject