Select statements on a table that has null fields

From: nathan <nathan(at)penguincomputing(dot)com>
To: "pgsql-sql(at)postgreSQL(dot)org" <pgsql-sql(at)postgreSQL(dot)org>
Subject: Select statements on a table that has null fields
Date: 1999-09-17 20:07:43
Message-ID: 37E29F8F.4162E6EF@penguincomputing.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Question : Postgres 6.5.1 Linux Redhat 6.0

I have a table that has 6 columns, 3 of the columns have data in every
field but the last 3 columns have some data and some null fields. When I
do a select statement and query on the columns that have a null field I
crash the connection. Is this normal or is this a bug or am I doing
something wrong ?

Example:

create table sales_info (

product_id int8
product_desc char(20),
in_stock int8, //some fields will be null
on_shelf int8, //some fields will be null
total_sold int8
item_cost float8
)

select * from sales_info where in_stock > 3;

This will crash if the in_stock column has some rows with null values.

Nathan

Browse pgsql-sql by date

  From Date Subject
Next Message Zot O'Connor 1999-09-17 21:04:07 Converting an existing table?
Previous Message Stephen Horton 1999-09-17 13:52:49 Re: pgsql-sql-digest V1 #355 - unsubscribe please