[GENERAL] Alternatives to a unique indexes with NULL

2015-01-17 Thread Peter Hicks
All, I have a Rails application on 9.3 in which I want to enforce a unique index on a set of fields, one of which includes a NULL-able column. According to http://www.postgresql.org/docs/9.3/static/indexes-unique.html, btree indexes can't handle uniqueness on NULL columns, so I'm looking

Re: [GENERAL] Alternatives to a unique indexes with NULL

2015-01-17 Thread Peter Hicks
Hi John On 17/01/15 12:39, John McKown wrote: ​I read the above. As I understand it, you can have a unique index on a column which is NULL-able. That will guarantee that all the non-NULL values are unique. What it will not guarantee is that there will be at most one NULL value in the indexed