title: how many arguments can be used with the IN clause in postgresql?
body: <p>I am executing a query in postgresql database from a java program, and the query is like:</p>
  
  <pre><code>SELECT ... FROM table_name WHERE column_name IN("&lt;list of values&gt;");
  </code></pre>
  
  <p>the problem is that the list of values is created dynamically and there is no limit to its size, and when this list is getting too big I am getting a PSQLException with the message: stack depth length exceeded.
  my question is how do I determine how many arguments can I use with the IN clause before this exception happens? let's say the max_stack_depth is 2MB, can I use that to determine how many arguments can I use with the IN clause?</p>