Re: Composite types and NULL within PL/pgSQL

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: David J N Begley <d(dot)begley(at)uws(dot)edu(dot)au>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Composite types and NULL within PL/pgSQL
Date: 2006-05-06 15:28:44
Message-ID: 5385.1146929324@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

David J N Begley <d(dot)begley(at)uws(dot)edu(dot)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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Will Reese 2006-05-06 16:04:04 Re: EnterpriseDB
Previous Message David J N Begley 2006-05-06 15:11:42 Composite types and NULL within PL/pgSQL