Re: Composite types and NULL within PL/pgSQL - Mailing list pgsql-general

From Tom Lane
Subject Re: Composite types and NULL within PL/pgSQL
Date
Msg-id 5385.1146929324@sss.pgh.pa.us
Whole thread Raw
In response to Composite types and NULL within PL/pgSQL  (David J N Begley <d.begley@uws.edu.au>)
Responses Re: Composite types and NULL within PL/pgSQL  (David J N Begley <d.begley@uws.edu.au>)
Re: Composite types and NULL within PL/pgSQL  (Greg Stark <gsstark@mit.edu>)
List pgsql-general
David J N Begley <d.begley@uws.edu.au> writes:
> So... why can I assign NULL to a composite type column in a table but not to a
> composite type variable in PL/pgSQL?  Is there any way to force that "out"
> composite type variable to be NULL?

In general the distinction between a true null composite value and a
row-of-nulls is not made very cleanly in PG.  I'd be inclined to
deprecate the former --- you cannot enter such a thing as a row of a
table, for example, and that is the basic property that any rowtype
ought to have no?

In short, don't do that.

            regards, tom lane

pgsql-general by date:

Previous
From: David J N Begley
Date:
Subject: Composite types and NULL within PL/pgSQL
Next
From: Will Reese
Date:
Subject: Re: EnterpriseDB