Q:

insert values to array column in PostgreSQL

I have table "details" with the below structure
id     status1      status2    names
 1    approved     rejected     NULL
 2    approved     rejected     NULL
 3    approved     rejected     NULL
 4    rejected     rejected     NULL

I want to insert values to array column "names" with default values {john,smith}
example :I need
  id     status1      status2    names
   1    approved     rejected   {john,smith}
   2    approved     rejected   {john,smith}
   3    approved     rejected   {john,smith}
   4    rejected     rejected   {john,smith}

It fails when i wrote 
INSERT INTO details (names) VALUES(ARRAY['john', 'smith']);

A:

If you want to keep existing values with new ones:
UPDATE details SET names = names || '{john, smith}';

A:

INSERT creates completely new rows - but you want to change existing rows, so you need to use UPDATE:
update details 
  set names  = ARRAY['john', 'smith'];

