"Don Morrison" <donmorrison(at)gmail(dot)com> writes:
> Has anyone come up with a way, or ways to trim leading and trailing
> whitespace, then do a case-insensitive uniqueness check efficiently
> and semi-elegantly?
Use a unique functional index, eg this handles the case sensitivity
issue:
create unique index fooi on foo (lower(name));
Suppressing whitespace is left as an exercise for the reader...
regards, tom lane