Re: problems with SELECT query results - Mailing list pgsql-sql

From Richard Broersma Jr
Subject Re: problems with SELECT query results
Date
Msg-id 267552.53183.qm@web31812.mail.mud.yahoo.com
Whole thread Raw
In response to Re: problems with SELECT query results  (Joshua <joshua@joshuaneil.com>)
List 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 by date:

Previous
From: Joshua
Date:
Subject: Re: problems with SELECT query results
Next
From: "Bart Degryse"
Date:
Subject: spi and error messages