From: Bhuvan A <bhuvansql(at)yahoo(dot)com>
To: pgsql-bugs(at)postgresql(dot)org
Subject:
Date: 2002-03-11 10:26:50
Message-ID: Pine.LNX.4.20.0203111553400.3514-100000@Larry
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs


On Mar 11, Stephan Szabo wrote:

>
> On Mon, 11 Mar 2002, Bhuvan A wrote:
>
> >
> >
> > On Mar 10, Stephan Szabo wrote:
> >
> > > On Mon, 11 Mar 2002, Bhuvan A wrote:
> > >
> > > > here i have a problem in comparing null values in plpgsql. this exist
> > > > in 7.1.x and 7.2 as well.
> > > >
> > > > the condition <null value> != <valid value> fails in plpgsql.
> > > > consider this function is triggered on every updation on a table.
> > > >
> > > > create function ftest()
> > > > returns opaque as 'declare
> > > >
> > > > begin
> > > >
> > > > if new.comp_code != old.comp_code then
> > > > ...
> > > > end if;
> > > > return new;
> > > > end;'
> > > > language 'plpgsql';
> > > >
> > > > this condition fails if old.comp_code is null and new.comp_code has
> > > > some value.
> > >
> > > <nullvalue> != <anything> is not true, it's unknown, so the if shouldn't
> >
> > what do you mean by <nullvalue> != <anything>?
>
> If you compare a NULL with anything you don't get a true value whether
> you're comparing with =, !=, <, >, etc... That's how it's defined to
> behave.

where did you get this definition of behaviour!? is it applicable only to
postgres or ..? its quite strange yaar!
>

Responses

  • Re: at 2002-03-11 14:33:30 from Yury Bokhoncovich
  • Re: at 2002-03-11 16:46:31 from Peter Eisentraut
  • Re: at 2002-03-11 17:02:09 from Stephan Szabo

Browse pgsql-bugs by date

  From Date Subject
Next Message Yury Bokhoncovich 2002-03-11 14:23:20 Re: Bug #608: cache lookup failed
Previous Message Stephan Szabo 2002-03-11 08:15:34 Re: comparing null value in plpgsql.