From: Gavin Kistner Date: 2005-04-04T23:03:07+09:00 Subject: [Rails] Introspect "not null" for a Column? Using Ruby on Rails, how can I tell if the DB schema allows a particular column in a table to be null or not? I don't see it in the attributes of a Column object. For example, this PSQL table: create table users ( id serial primary key, user varchar(200) not null, passcrypt varchar(15) not null, disabled_flag boolean default '0', zip varchar(10) not null, firstname varchar(50), lastname varchar(50), nickname varchar(50), email varchar(50), phone varchar(25) ); produces the following columns through introspection: # # # # # # # # # # Note that the last 5 columns (in the sql) may be null, but are not differentiated as such in the Column instances. -- (-, /\ \/ / /\/