Re: problems with SELECT query results

Поиск
Список
Период
Сортировка
От Richard Broersma Jr
Тема Re: problems with SELECT query results
Дата
Msg-id 267552.53183.qm@web31812.mail.mud.yahoo.com
обсуждение исходный текст
Ответ на Re: problems with SELECT query results  (Joshua <joshua@joshuaneil.com>)
Список pgsql-sql
--- Joshua <joshua@joshuaneil.com> wrote:

> Hello,
> 
> Thank you all for your assistance. I did end up finding NULL in the 
> 'onorder' column which should have been zero's.... this was in a test 
> table that happened to have some NULL in it for one reason or another 
> but I should not find this in the production version of the table.

If this should be allowed to have nulls, you should add a not null constraint to your table to
prevent this sort of thing from happening.  If a field should have zero's instead of nulls, you
should also add a default value of zero for this column.

ALTER TABLE Slparts ALTER COLUMN onorder SET NOT NULL, ALTER COLUMN onorder SET DEFAULT 0;

Regards,
Richard Broersma Jr.


В списке pgsql-sql по дате отправления:

Предыдущее
От: Joshua
Дата:
Сообщение: Re: problems with SELECT query results
Следующее
От: "Bart Degryse"
Дата:
Сообщение: spi and error messages