Re: array element replace ?

From: Andrej <andrej(dot)groups(at)gmail(dot)com>
To: "Gauthier, Dave" <dave(dot)gauthier(at)intel(dot)com>
Cc: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: array element replace ?
Date: 2010-01-21 23:53:30
Message-ID: b35603931001211553i757152dfjacaa870b557827ba@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

2010/1/22 Gauthier, Dave <dave(dot)gauthier(at)intel(dot)com>:
> Is there a clever way to replace a single element in an array with another
> value?
>
>
>
> E.g.
>
>
>
> x = array[‘a’,’b’,’c’,’d’];
>
> I want to replace ‘b’ with ‘x’.
>
Not sure you can replace an array value with an array (which kind of is
what you're asking in your example), but:

http://www.postgresql.org/docs/8.4/static/arrays.html
Specifically section
8.14.4. Modifying Arrays

Cheers,
Andrej

--
Please don't top post, and don't use HTML e-Mail :} Make your quotes concise.

http://www.american.edu/econ/notes/htmlmail.htm

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Martijn van Oosterhout 2010-01-22 00:13:13 Re: Error "invalid byte sequence for encoding UTF8" on insert into BYTEA column
Previous Message Gauthier, Dave 2010-01-21 23:45:50 array element replace ?