pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Richard Broersma Jr <rabroersma@yahoo.com>
To: Joshua <joshua@joshuaneil.com>
To: Richard Huxton <dev@archonet.com>
Cc: pgsql-sql@postgresql.org
Subject: Re: problems with SELECT query results
Date: Tue, 29 May 2007 13:35:06 -0700 (PDT)
Message-ID: <267552.53183.qm@web31812.mail.mud.yahoo.com> (raw)
In-Reply-To: <465C6705.5000505@joshuaneil.com>


--- 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.



view thread (5+ messages)

Message-ID: <267552.53183.qm@web31812.mail.mud.yahoo.com>
Permalink:  ../267552.53183.qm@web31812.mail.mud.yahoo.com/
Also on:    postgresql.org/message-id/267552.53183.qm@web31812.mail.mud.yahoo.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: rabroersma@yahoo.com, joshua@joshuaneil.com, dev@archonet.com
  Subject: Re: problems with SELECT query results
  In-Reply-To: <267552.53183.qm@web31812.mail.mud.yahoo.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox