Received: from localhost (unknown [200.46.204.187]) by postgresql.org (Postfix) with ESMTP id AFA539F9A44 for ; Thu, 4 Oct 2007 04:24:12 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.187]) (amavisd-maia, port 10024) with ESMTP id 25085-04 for ; Thu, 4 Oct 2007 04:24:10 -0300 (ADT) Received: from news.hub.org (news.hub.org [200.46.204.72]) by postgresql.org (Postfix) with ESMTP id 4BF849F9931 for ; Thu, 4 Oct 2007 04:24:12 -0300 (ADT) Received: from news.hub.org (news.hub.org [200.46.204.72]) by news.hub.org (8.14.1/8.14.1) with ESMTP id l947O9IC030421 for ; Thu, 4 Oct 2007 04:24:09 -0300 (ADT) (envelope-from news@news.hub.org) Received: (from news@localhost) by news.hub.org (8.14.1/8.14.1/Submit) id l946v4C7081370 for pgsql-admin@postgresql.org; Thu, 4 Oct 2007 03:57:04 -0300 (ADT) (envelope-from news) From: yogesh.arora.daffodil@gmail.com X-Newsgroups: pgsql.admin Subject: Re: Postgres Array Traversing Date: Thu, 04 Oct 2007 06:57:05 -0000 Organization: http://groups.google.com Lines: 31 Message-ID: <1191481025.361203.55090@w3g2000hsg.googlegroups.com> References: <116685ec0710030327v7e35b5d3s7a9202e98be4ad2@mail.gmail.com> <4703B524.50108@radev.net> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" X-Complaints-To: groups-abuse@google.com In-Reply-To: <4703B524.50108@radev.net> User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.8.1.7) Gecko/20070914 Firefox/2.0.0.7,gzip(gfe),gzip(gfe) X-HTTP-Via: 1.1 SUMAN1, 1.1 SIFY Complaints-To: groups-abuse@google.com Injection-Info: w3g2000hsg.googlegroups.com; posting-host=124.30.27.18; posting-account=ps2QrAMAAAA6_jCuRt2JEIpn5Otqf_w0 To: pgsql-admin@postgresql.org X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200710/18 X-Sequence-Number: 26932 On Oct 3, 8:28 pm, mi...@radev.net ("Milen A. Radev") wrote: > Yogesh Arora :> Hallo All Frnds, > > > I have to add an array in my table. and to update the array in a > > Procedure called by the trigger. > > > In my case Like the Elements of the array are {1,2,5} now i have to > > update it to {1,2,5,7} . I.e., Keeping the previous record as such and > > appending the new elements. > > [...] > > According to the manual > (http://www.postgresql.org/docs/current/static/arrays.html#AEN5830) this > should work: > > UPDATE example_table SET an_array_column = an_array_column || 7 WHERE > a_key_column = ; > > P.S. This questions is probably more appropriate for the "pgsql-sql" list. > > -- > Milen A. Radev > > ---------------------------(end of broadcast)--------------------------- > TIP 7: You can help support the PostgreSQL project by donating at > > http://www.postgresql.org/about/donate Thanks Milen A. Radev It Works..