Skip to main content
changed to a more sensible title
Link

Function with array parameter that loops through array parameter values to build multiple WHERE clauses (postgres 11.4)

edited title
Link

Function with array parameter that loops through values in array to build multiple WHERE clauses (postgres 11.4)

added 1 character in body
Source Link

I made a bit of progress after following the (very well-written) answers to some questions here, but I am still stuck wrapping my head around how to generate a   WHERE clauses for each input array element.

...but obviously this isn't looping over anything. I have experimented with replacing the FROM locations loc clause with FROM generate_subscripts($1, 1) and attempting to loop through that way, but replacing the table name causes and attempting to loop through that way, but replacing the table name causes my left myouter joinleft outer join`'s's to fail.

I made a bit of progress after following the (very well-written) answers to some questions here, but I am still stuck wrapping my head around how to generate a WHERE clauses for each input array element.

...but obviously this isn't looping over anything. I have experimented with replacing the FROM locations loc clause with FROM generate_subscripts($1, 1) and attempting to loop through that way, but replacing the table name causes my left outer join`'s to fail.

I made a bit of progress after following the (very well-written) answers to some questions here, but I am still stuck wrapping my head around how to generate   WHERE clauses for each input array element.

...but obviously this isn't looping over anything. I have experimented with replacing the FROM locations loc clause with FROM generate_subscripts($1, 1) and attempting to loop through that way, but replacing the table name causes my left outer join's to fail.

Source Link
Loading