Re: delete item[5] from varchar[] array??? - Mailing list pgsql-sql

From Michael Fuhr
Subject Re: delete item[5] from varchar[] array???
Date
Msg-id 20050923191057.GA81954@winnie.fuhr.org
Whole thread Raw
In response to Re: delete item[5] from varchar[] array???  (Matthew Peter <survivedsushi@yahoo.com>)
Responses Re: delete item[5] from varchar[] array???
List pgsql-sql
On Fri, Sep 23, 2005 at 10:02:44AM -0700, Matthew Peter wrote:
> --- Michael Fuhr <mike@fuhr.org> wrote:
> > test=> UPDATE foo SET a = a[1:3] || a[5:6];
>
> I sure hope there is a better way :) There must be an
> easy, native way to interface with arrays.

Hoping a thing is true doesn't mean it must be true :-)

> We all know programming languages have ways to delete items in an
> array natively, it just needs to be exposed.

No, we don't all know that because it isn't generally true, or else
you're using a loose definition of "natively."  Languages differ
in what capabilities they offer "natively."

contrib/intarray implements an intarray_del_elem() function,
presumably because the core product doesn't offer that capability,
or at least didn't when the module was written.  If you think it's
there just waiting to be exposed, then dig into the source code and
expose it :-)

-- 
Michael Fuhr


pgsql-sql by date:

Previous
From: Daryl Richter
Date:
Subject: Re: Updating cidr column with network operator
Next
From: Axel Rau
Date:
Subject: Re: Updating cidr column with network operator