Search Postgresql Archives

targetted array element modification or delete without knowing the index?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Is there a way to modify or delete an element of an array with knowledge only of the element’s value?  Maybe an array index finder would help?

 

For example

 

create table foo (name,text, arr text[]);

insert into foo (name,arr) values (‘joe’,ARRAY[‘a’,’b’,’c’]);

 

 

update foo set arr[indexfinder(‘b’)] = ‘z’;

 

This would update arr[2], because that’s the element with value ‘b’

 

Thanks !


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux