Re: Query performance problem

From: Ragnar Hafstað <gnari(at)simnet(dot)is>
To: Kenneth Gonsalves <lawgon(at)thenilgiris(dot)com>
Cc: Richard Huxton <dev(at)archonet(dot)com>, weberp(at)paradise(dot)net(dot)nz, pgsql-sql(at)postgresql(dot)org
Subject: Re: Query performance problem
Date: 2005-03-18 07:32:52
Message-ID: 1111131172.25405.17.camel@localhost.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

On Fri, 2005-03-18 at 10:49 +0530, Kenneth Gonsalves wrote:
> On Thursday 17 Mar 2005 7:35 pm, Richard Huxton wrote:
>
> > Not necessarily. NOT NULL here helps to ensure you can add values
> > together without the risk of a null result. There are plenty of
> > "amount" columns that should be not-null (total spent, total
> > ordered etc).
>
> that makes sense - but is it necessary to have a not null constraint
> when there is a default value?

DEFAULT applies to INSERTs, NOT NULL applies to UPDATEs too.

gnari

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message PFC 2005-03-18 09:10:10 Re: Query performance problem
Previous Message Kenneth Gonsalves 2005-03-18 05:19:47 Re: Query performance problem