Re: Checking for string data that makes sense Re: postgresql vs mysql
В списке pgsql-general по дате отправления:
| От | Zoltan Boszormenyi |
|---|---|
| Тема | Re: Checking for string data that makes sense Re: postgresql vs mysql |
| Дата | |
| Msg-id | 45DD7006.5050701@dunaweb.hu обсуждение исходный текст |
| Ответ на | Re: Checking for string data that makes sense Re: postgresql vs mysql (CaT <cat@zip.com.au>) |
| Ответы |
Re: Checking for string data that makes sense Re: postgresql vs mysql
|
| Список | pgsql-general |
CaT írta: > On Thu, Feb 22, 2007 at 09:13:13AM +0100, Zoltan Boszormenyi wrote: > >> Chris ?rta: >> >>> CaT wrote: >>> >>>> On Thu, Feb 22, 2007 at 01:08:04PM +1100, Chris wrote: >>>> >>>>> create table a(a text not null check (char_length(a) > 0)); >>>>> >>>> What's wrrong with using >>>> >>>> a <> '' >>>> >>> Nothing, I just thought of the other way first :) >>> >> I would do a CHECK (trim(a) <> '') >> > > Whitespaces are values too, you know. > Yes, I know. But e.g. for a real people name, would you store accidentally entered spaces before or after the actual name, too? Which would also ruin sorting by name. But of course, it doesn't make sense in every case.
В списке pgsql-general по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера