I am executing a query in postgresql database from a java program, and the query is like:
SELECT ... FROM table_name WHERE column_name IN("<list of values>");
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?