Re: NULLs in array_cat vs array || array

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Thom Brown <thom(at)linux(dot)com>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: NULLs in array_cat vs array || array
Date: 2011-02-15 21:47:42
Message-ID: 11693.1297806462@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Thom Brown <thom(at)linux(dot)com> writes:
> I assumed array_cat would behave similarly to array || array, but it
> appears not when it comes to NULLs. Shouldn't these have identical
> functionality? The attached patch makes it so, although it would
> break existing code.

That patch is the hard way: the right change would be to remove the code
altogether and mark the function strict in pg_proc. However, the fact
that it's not like that already shows that we went out of our way to
make it so. I don't think we should undo that decision just because
somebody submits a patch to do so.

Also, so far as I can see array_cat *is* ||, so I'm not sure what
discrepancy in behavior you're on about.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Dimitri Fontaine 2011-02-15 21:49:01 Re: Extensions vs PGXS' MODULE_PATHNAME handling
Previous Message Cédric Villemain 2011-02-15 21:46:09 Re: NULLs in array_cat vs array || array