Search Postgresql Archives

Re: How to remove an item from integer array type

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

 



>Moving the exclusion operation up a level seems to do the trick:
>
>testdb=# BEGIN ;
>BEGIN
>testdb=*# update tableA set f2 = (select array_agg(X.id) from (select f1, unnest(f2) id from tablea where f1 = 1) x WHERE x.id != 101) where f1=1; UPDATE 1 testdb=*# SELECT * from tablea ;
> f1 |           f2
>----+-------------------------
>  1 | {100,102,103,99,104,22}
> (1 row)
>
> (It's a bit late where  I am so I might be overlooking something)
>
>
>Ian Barwick

You're absolutely correct Ian.
(It's getting late here too ;) )

-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general



[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