Re: Composite type evaluates to Null if any element is null - Mailing list pgsql-general

From Merlin Moncure
Subject Re: Composite type evaluates to Null if any element is null
Date
Msg-id b42b73150812170850w3cc2a2far2edf72bd021e5fdc@mail.gmail.com
Whole thread Raw
In response to Composite type evaluates to Null if any element is null  (Ketema Harris <ketema@ketema.net>)
Responses Re: Composite type evaluates to Null if any element is null  ("Andrew Gould" <andrewlylegould@gmail.com>)
List pgsql-general
On Wed, Dec 17, 2008 at 11:09 AM, Ketema Harris <ketema@ketema.net> wrote:
> I have just re-read chapter 8.15 of the 8.3 manual and I am understanding
> why a composite type would evaluate to NUll if any of it elements are null.
>
> Can anyone explain this behavior?  To me if I have a composite type column
> and there are some values in it, its incomplete, yes, but not null.

can you be a little more specific?

postgres=# create table ct(a int, b int, c int);
CREATE TABLE
postgres=#
postgres=# select (1, null, 2)::ct;
  row
--------
 (1,,2)
(1 row)

postgres=# select (1, null, 2)::ct is null;
 ?column?
----------
 f
(1 row)

note, there is significant behavior change in the way composite type
works in comparison purposes for 8.4, which I am using.

merlin

pgsql-general by date:

Previous
From: "Willy-Bas Loos"
Date:
Subject: Re: what happens to indexes when TRUNCATEing
Next
From: "Andrew Gould"
Date:
Subject: Re: Composite type evaluates to Null if any element is null