In mysql or postgres, is there a limit to the size of an IN (1,2,n) statement? In mysql or postgres, is there a limit to the size of an IN (1,2,n) statement? postgresql postgresql

In mysql or postgres, is there a limit to the size of an IN (1,2,n) statement?


The 1000 limit in PostgreSQL is not a hard limit, it is a optimization limit, i.e; after 1000 PostgreSQL doesn't handle it very well. Of course I have to ask what in the world are you doing with a 1000 entry IN clause.


There is no technical limit, but there is a some kind of 'good sense' limit..

Having too much elements in the IN clause means the query have probably a bad design (imho)


For MySQL, from the manual:

The number of values in the IN list is only limited by the max_allowed_packet value.