Re: Support for array_remove and array_replace functions

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Marco Nenciarini <marco(dot)nenciarini(at)2ndquadrant(dot)it>
Cc: Alex Hunsaker <badalex(at)gmail(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Support for array_remove and array_replace functions
Date: 2012-07-11 18:06:55
Message-ID: 15405.1342030015@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Marco Nenciarini <marco(dot)nenciarini(at)2ndquadrant(dot)it> writes:
> Patch v3 attached.

Applied with mostly-but-not-entirely cosmetic adjustments.

I left array_remove throwing error for multi-dimensional arrays for
the moment, because I realized that changing the dimensionality as
I suggested would conflict with the optimization to return the original
array if there were no matches. I don't think we'd want the definition
to read "multidimensional arrays are changed to one dimension, but only
if at least one element is removed" --- that's getting a little too
weird. If anyone's really hot to make it work on multi-D arrays, we
could consider disabling that optimization; it's not clear to me that
it's worth a lot. But for now I'm willing to stick with the
throw-an-error approach.

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Matthew Woodcraft 2012-07-11 18:10:37 Re: DELETE vs TRUNCATE explanation
Previous Message Merlin Moncure 2012-07-11 18:01:54 Re: Schema version management