Skip site navigation (1) Skip section navigation (2)

Re: coalesce with all nulls can only be assigned to

From: Richard Huxton <dev(at)archonet(dot)com>
To: Kevin Grittner <Kevin(dot)Grittner(at)wicourts(dot)gov>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-general(at)postgresql(dot)org
Subject: Re: coalesce with all nulls can only be assigned to
Date: 2006-11-29 20:11:23
Message-ID: 456DE96B.8030806@archonet.com (view raw or flat)
Thread:
Lists: pgsql-general
Kevin Grittner wrote:
>>>> On Wed, Nov 29, 2006 at  1:38 PM, in message
> <21909(dot)1164829090(at)sss(dot)pgh(dot)pa(dot)us>,
> Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote: 
>> "Kevin Grittner" <Kevin(dot)Grittner(at)wicourts(dot)gov> writes:
>>> Richard Huxton <dev(at)archonet(dot)com> wrote: 
>>>> It's the coalesce that has the problem, not the insert. The
> coalesce is 
>>>> deciding that it's working on text, and so returns text.
>>  
>>> It seems like maybe it would be worth overloading the coalesce
> method
>>> to handle this particular case differently.
>> And do what?  The only information you have is that all the inputs
> are
>> of unknown type.
>  
> I know this is naive, but, what is the type information of the bare
> null?  Could that be used?

A literal null is "unknown", other literals are "unknown" or 
"unknown-numeric" based on quoting iirc.

Hmm - Tom would it be possible to create a cast to unknown, explicitly 
cast this coalesce to unknown and let it implicitly cast back to 
whatever the column needs?

-- 
   Richard Huxton
   Archonet Ltd

In response to

pgsql-general by date

Next:From: Vivek KheraDate: 2006-11-29 20:16:41
Subject: Re: Postgresql data integrity during RAID10 drive rebuild
Previous:From: Martijn van OosterhoutDate: 2006-11-29 20:09:43
Subject: Re: coalesce with all nulls can only be assigned to

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group