Updating Arrays - Mailing list pgsql-general

From Bob Pawley
Subject Updating Arrays
Date
Msg-id 707FB95957B14DB880D259EE0011F29F@BobPC
Whole thread Raw
Responses Re: Updating Arrays  (Merlin Moncure <mmoncure@gmail.com>)
List pgsql-general
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}"”
 
Bob
 
Create table library.compare (
id serial UNIQUE,
process_id int4,
device_id int4,
_base decimal[]
);
Insert into library.compare (process_id)
values ('2');

pgsql-general by date:

Previous
From: John R Pierce
Date:
Subject: Re: securing the sql server ?
Next
From: Merlin Moncure
Date:
Subject: Re: Updating Arrays