Re: [SQL] update some elements in the array

2000-07-13 Thread Tom Lane
Bernie Huang <[EMAIL PROTECTED]> writes: > however, that might be troublesome, so I tried > UPDATE table > SET arr[1]=val1 > arr[2]=val2... > but it didn't work. Hmm, probably not ... I don't see any easy way around that, since the array elements aren't really separate fields. Under the hood

Re: [SQL] update some elements in the array

2000-07-13 Thread Bernie Huang
Jouni Ahto wrote: > On Thu, 13 Jul 2000, Bernie Huang wrote: > > > I want to update the last three element without affecting other > > elements. I could have done it by retrieving all elements in the array > > first and the do a > > > > UPDATE table > > SET arr='{"1","2","3","4","5"}' > > WHERE

[SQL] update some elements in the array

2000-07-13 Thread Bernie Huang
Hello, Could someone please tell me that is there anyway that I can update only a few elements in a Postgres array. eg; I have an array of text, declared as 'text[]'. {"1","2","3","4","5"} ==> {"1","2","7","8","9"} I want to update the last three element without affecting other elements. I