Skip to content
Advertisement

PL/pgSQL SELECT into an array

Here’s my function declaration and part of the body:

I want team_ids to be an array of ints that I can then use in the UPDATE statement. This function give me errors like this:

Advertisement

Answer

Faster and simpler with a FROM clause in your UPDATE statement:

That aside, while operating with an array, the WHERE clause would have to be:

The IN construct works with lists or sets, not with arrays. See:

User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement