title: Postgresql: [42883] ERROR: operator does not exist: text || integer[]
body: <p>I getting error like below: [42883] ERROR: operator does not exist: text || integer[] Hint: No operator matches the given name and argument type(s). You might need to add explicit type casts. I cannot fix this problem and tried so many times.</p>
  
  <p>My Code:</p>
  
  <pre><code>DECLARE
  
  arr_operators       integer[1,2];
  
  BEGIN
  query1 := 'SELECT * FROM dist.' || _rec1.table_name || ' WHERE operator_id = ANY (''' || arr_operators || ''');';
  
  FOR _rec IN EXECUTE query1 LOOP
  
  END LOOP;
  </code></pre>
  
  <p>I think problem is happening when I am makin query string.But when I use this statement in query directly lik below is working well:</p>
  
  <pre><code>FOR _rec1 IN (SELECT * FROM dist.sirdarya WHERE id = any (arr_operators)) LOOP
  
           INSERT INTO dist.justt(column1,column2) VALUES (_rec1.id,_rec1.msisdn);
  
  END LOOP;
  </code></pre>
  
  <p>Any help is appreciated.</p>