Skip site navigation (1) Skip section navigation (2)

Peripheral Links

Header And Logo

PostgreSQL
| The world's most advanced open source database.

Site Navigation

Search for
  Advanced Search

Re: problems with SELECT query results



--- Joshua <joshua(at)joshuaneil(dot)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.



Home | Main Index | Thread Index

Privacy Policy | PostgreSQL Archives hosted by Command Prompt, Inc. | Designed by tinysofa
Copyright © 1996 – 2008 PostgreSQL Global Development Group