X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 8DB00D92A7 for ; Fri, 23 Sep 2005 16:11:07 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 51306-06 for ; Fri, 23 Sep 2005 19:11:01 +0000 (GMT) Received: from tigger.fuhr.org (tigger.fuhr.org [63.214.45.158]) by svr1.postgresql.org (Postfix) with ESMTP id 2D653D90C1 for ; Fri, 23 Sep 2005 16:11:01 -0300 (ADT) Received: from winnie.fuhr.org (winnie.fuhr.org [10.1.0.1]) by tigger.fuhr.org (8.13.3/8.13.3) with ESMTP id j8NJAxir058643 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 23 Sep 2005 13:11:01 -0600 (MDT) (envelope-from mfuhr@winnie.fuhr.org) Received: from winnie.fuhr.org (localhost [127.0.0.1]) by winnie.fuhr.org (8.13.3/8.13.3) with ESMTP id j8NJAw8h002672; Fri, 23 Sep 2005 13:10:58 -0600 (MDT) (envelope-from mfuhr@winnie.fuhr.org) Received: (from mfuhr@localhost) by winnie.fuhr.org (8.13.3/8.13.3/Submit) id j8NJAw8w002671; Fri, 23 Sep 2005 13:10:58 -0600 (MDT) (envelope-from mfuhr) Date: Fri, 23 Sep 2005 13:10:58 -0600 From: Michael Fuhr To: Matthew Peter Cc: pgsql-sql@postgresql.org Subject: Re: delete item[5] from varchar[] array??? Message-ID: <20050923191057.GA81954@winnie.fuhr.org> References: <20050922031511.GB90260@winnie.fuhr.org> <20050923170244.72178.qmail@web35206.mail.mud.yahoo.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050923170244.72178.qmail@web35206.mail.mud.yahoo.com> X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.006 required=5 tests=[AWL=0.006] X-Spam-Level: X-Archive-Number: 200509/236 X-Sequence-Number: 22783 On Fri, Sep 23, 2005 at 10:02:44AM -0700, Matthew Peter wrote: > --- Michael Fuhr 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