On Wed, Nov 28, 2012 at 11:06 AM, Gary Weaver <garyswea...@gmail.com> wrote:
> Jeremy, > > I looked at the postgres documentation and it looked like it is both > column level and table level, but maybe I misread it- could you look? > > http://www.postgresql.org/docs/9.1/static/sql-createtable.html > > > CREATE [ [ GLOBAL | LOCAL ] { TEMPORARY | TEMP } | UNLOGGED ] TABLE [ IF NOT > EXISTS ] table_name >> OF type_name [ ( >> { column_name WITH OPTIONS [ column_constraint [ ... ] ] >> | table_constraint } >> [, ... ] >> ) ] >> [ WITH ( storage_parameter [= value] [, ... ] ) | WITH OIDS | WITHOUT OIDS ] >> [ ON COMMIT { PRESERVE ROWS | DELETE ROWS | DROP } ] >> [ TABLESPACE tablespace ] >> where column_constraint is: >> >> [ CONSTRAINT constraint_name ] >> { NOT NULL | >> NULL | >> CHECK ( expression ) | >> DEFAULT default_expr | >> UNIQUE index_parameters | >> PRIMARY KEY index_parameters | >> REFERENCES reftable [ ( refcolumn ) ] [ MATCH FULL | MATCH PARTIAL | MATCH >> SIMPLE ] >> [ ON DELETE action ] [ ON UPDATE action ] } >> [ DEFERRABLE | NOT DEFERRABLE ] [ INITIALLY DEFERRED | INITIALLY IMMEDIATE ] >> and table_constraint is: >> >> [ CONSTRAINT constraint_name ] >> { CHECK ( expression ) | >> UNIQUE ( column_name [, ... ] ) index_parameters | >> PRIMARY KEY ( column_name [, ... ] ) index_parameters | >> EXCLUDE [ USING index_method ] ( exclude_element WITH operator [, ... ] ) >> index_parameters [ WHERE ( predicate ) ] | >> FOREIGN KEY ( column_name [, ... ] ) REFERENCES reftable [ ( refcolumn [, >> ... ] ) ] >> [ MATCH FULL | MATCH PARTIAL | MATCH SIMPLE ] [ ON DELETE action ] [ ON >> UPDATE action ] } >> [ DEFERRABLE | NOT DEFERRABLE ] [ INITIALLY DEFERRED | INITIALLY IMMEDIATE ] >> >> It's neither column-level nor table-level, it's constraint-level. Tables can have multiple constraints, each with different DEFERRABLE values, and those constraints are not necessarily tied to specific columns. Jeremy -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-core+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en.