Re: Use of !~* to keep a varchar column UNIQUE
От | Daniel T. Staal |
---|---|
Тема | Re: Use of !~* to keep a varchar column UNIQUE |
Дата | |
Msg-id | 56522.63.172.115.138.1155927569.squirrel@MageHandbook.com обсуждение исходный текст |
Ответ на | Re: Use of !~* to keep a varchar column UNIQUE case-insensitive ("Don Morrison" <donmorrison@gmail.com>) |
Ответы |
Re: Use of !~* to keep a varchar column UNIQUE
|
Список | pgsql-novice |
On Fri, August 18, 2006 1:52 pm, Don Morrison said: > The above works well enough, and I can live with it, but it is not > comprehensive...it would be nice to use a regular expression....and do > something like: The other way of doing this, depending on your data integrety needs, would be to use a before trigger on insert, which could trim the space and convert to some normalized case. PL/Perl would be a good language for this. ;) Of course that has the problem of changing the data before it is inserted. It is up to you to decide if this change reperesnts a problem in your particular case. (I would think it probably would cause the database to run a little faster: The processing only would happen once, at insert time, instead of whenever the index is re-created. Probably not significant in most cases though.) Daniel T. Staal --------------------------------------------------------------- This email copyright the author. Unless otherwise noted, you are expressly allowed to retransmit, quote, or otherwise use the contents for non-commercial purposes. This copyright will expire 5 years after the author's death, or in 30 years, whichever is longer, unless such a period is in excess of local copyright law. ---------------------------------------------------------------
В списке pgsql-novice по дате отправления: