Unsigned numbers
От | Kaloyan Iliev Iliev |
---|---|
Тема | Unsigned numbers |
Дата | |
Msg-id | 3FC48A26.1090407@faith.digsys.bg обсуждение исходный текст |
Ответы |
Re: Unsigned numbers
|
Список | pgsql-sql |
Hello Friends, I have the following questions. I have a lot of fields in my database that are int or float. The problem is that I need them to be only positive (unsigned) and the users try to insert sometimes negative. I know that I can make this with CHECK CONSTRAINT but for some reasons this is not a good solution for me. The reason is that when I have a check constraint on a certain field and someone try to insert negative number the error message contains the name of the constraint and the name of the table but not the name of the field. So on higher level I can't send a proper message to the user. Are there any unsigned data types like unsigned int or unsigned float. Can I make a domain or something like that (How exactly to add constraint to domain). I am using v7.3.2. Thanks!
В списке pgsql-sql по дате отправления: