Re: Updating Arrays

From: Merlin Moncure <mmoncure(at)gmail(dot)com>
To: Bob Pawley <rjpawley(at)shaw(dot)ca>
Cc: Postgresql <pgsql-general(at)postgresql(dot)org>
Subject: Re: Updating Arrays
Date: 2011-08-22 18:03:09
Message-ID: CAHyXU0znuFVo+LdjuRBKL-Vbhb2=3gVwxcusJ8JYEyNpVxLPXQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Mon, Aug 22, 2011 at 12:54 PM, Bob Pawley <rjpawley(at)shaw(dot)ca> wrote:
> Hi
>
> I exploring the use of arrays.
>
> So far I have created a table and inserted a row and updated the row with an
> array
> Update library.compare
>   set _base =
>   '{2, 0.764149497122068, 4.8886}'
>   where process_id = 2;
> – successfully.
>
> However when I attempt to update a specific element of the array
>
> Update library.compare
> set _base[2] =
> '{2}'
> where process_id = 2;
> I get an error “invalid input syntax for type numeric: "{2}"”

try "set base[2] = 2"

merlin

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Chris Travers 2011-08-22 18:09:55 Re: securing the sql server ?
Previous Message Bob Pawley 2011-08-22 17:54:54 Updating Arrays