pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Michael Fuhr <mike@fuhr.org>
To: Matthew Peter <survivedsushi@yahoo.com>
Cc: pgsql-sql@postgresql.org
Subject: Re: delete item[5] from varchar[] array???
Date: Fri, 23 Sep 2005 13:10:58 -0600
Message-ID: <20050923191057.GA81954@winnie.fuhr.org> (raw)
In-Reply-To: <20050923170244.72178.qmail@web35206.mail.mud.yahoo.com>
References: <20050922031511.GB90260@winnie.fuhr.org>
	<20050923170244.72178.qmail@web35206.mail.mud.yahoo.com>

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



view thread (7+ messages)  latest in thread

Message-ID: <20050923191057.GA81954@winnie.fuhr.org>
Permalink:  ../20050923191057.GA81954@winnie.fuhr.org/
Also on:    postgresql.org/message-id/20050923191057.GA81954@winnie.fuhr.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: mike@fuhr.org, survivedsushi@yahoo.com
  Subject: Re: delete item[5] from varchar[] array???
  In-Reply-To: <20050923191057.GA81954@winnie.fuhr.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox