Re: delete item[5] from varchar[] array???

From: Matthew Peter <survivedsushi(at)yahoo(dot)com>
To: Michael Fuhr <mike(at)fuhr(dot)org>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: delete item[5] from varchar[] array???
Date: 2005-09-24 02:51:53
Message-ID: 20050924025153.62888.qmail@web35205.mail.mud.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

--- Michael Fuhr <mike(at)fuhr(dot)org> wrote:

> On Fri, Sep 23, 2005 at 10:02:44AM -0700, Matthew
> Peter wrote:
> > --- Michael Fuhr <mike(at)fuhr(dot)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
>

Yes. I should've said "most" and some thanks to libs.
I'm busy in other source which is why I hoped those
who were already engulfed in pg's source would have a
solution... Thought this functionality may be
around... somewhere.... which is why I asked.

Took a brief look at intarray_del_elem() function you
mentioned. This may be perfect, and then some. I'll
play around with it. Thanks

__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Ilya A. Kovalenko 2005-09-24 04:56:12 VACUUM FULL vs dump & restore
Previous Message Axel Rau 2005-09-23 19:24:57 Re: Updating cidr column with network operator