Re: [HACKERS] NULL handling question

From: Thomas Lockhart <lockhart(at)alumni(dot)caltech(dot)edu>
To: "Vazsonyi Peter[ke]" <neko(at)kornel(dot)szif(dot)hu>
Cc: hackers(at)postgreSQL(dot)org
Subject: Re: [HACKERS] NULL handling question
Date: 1999-03-29 15:47:15
Message-ID: 36FFA083.E716298B@alumni.caltech.edu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> I don't seek this in the source, but i think, all function, who take a
> NULL value as parameter can't return with a NOT NULL value.
> But why?

Postgres assumes that a NULL input will give a NULL output, and never
calls your routine at all. Since NULL means "don't know", there is a
strong argument that this is correct behavior.

> And can i check about an int4 if IS NULL ?

Not as cleanly as the pass-by-reference data types. I vaguely recall
that the input and output routines can look for a second or third
argument, one of which is a NULL indicator. But that mechanism is not
generally usable in other contexts afaik.

- Tom

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 1999-03-29 15:51:03 Re: [HACKERS] Another new regress test
Previous Message Tom Lane 1999-03-29 15:45:07 Re: [HACKERS] libpq++