-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
 
 
> I've encountered an SQL statement like:
> select x from y where z in (1, 2, ...)
> and where the () contains about 10,000 numbers of up to 5 digits each,
> so the entire SQL statement is about 57,000 bytes long.
>
> MySQL runs it without error, suggesting a 64 Kb limit on individual
> statements, but Postgres throws the above error, suggesting a limit
> of 32 Kb per statement. I admit I'm guessing re the statement length limits.
 
I'm not sure why you think this is a DBI issue: the better place to ask
is on one of the PostgreSQL mailing lists. You also do not state which
version you are using, which is the minimum amount of information that
should be provided with your question. If you were using a recent version
of PostgreSQL, you may have seen a hint about boosting the "max_expr_depth"
parameter, which is what you are running up against here. The default for
this is set at 10,000 which is a fairly sane maximum for most SQL queries.
 
The solution is to either redesign your query (e.g. make and join against a
temporary table) or boost this parameter in postgresql.conf. Note that 8.0
will replace max_expr_depth with max_stack_depth, which helps guard against
recursive functions running out of control.
 
Your logic that "because it worked, MySQL's limit must be 65kb" may be as bogus
as the PostgreSQL 32kb logic, but I don't know MySQL well enough to say.
 
- --
Greg Sabino Mullane [EMAIL PROTECTED]
PGP Key: 0x14964AC8 200411160742
 
-----BEGIN PGP SIGNATURE-----
 
iD8DBQFBmfiovJuQZxSWSsgRAruxAJ9+rgdhKTu5qz76fPfMqVdHfn70LwCg3NHE
H13+0Nte8nz1pU/TufFIhFU=
=7uU1
-----END PGP SIGNATURE-----


Reply via email to