Max length of SQL statement

Started by Carmen Waiover 22 years ago2 messagesgeneral
Jump to latest
#1Carmen Wai
wai_carmen@hotmail.com

Hello:

Do any one know the max length of a SQL statement?

Thanks!
Carmen

_________________________________________________________________
No masks required! Use MSN Messenger to chat with friends and family.
http://go.msnserver.com/HK/25382.asp

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Carmen Wai (#1)
Re: Max length of SQL statement

"Carmen Wai" <wai_carmen@hotmail.com> writes:

Do any one know the max length of a SQL statement?

There is no specific limit; it'll depend on available memory and
complexity of the statement. I've run tests with multi-megabyte
string literals, tens of thousands of WHERE clauses, etc.

MySQL's "crashme" test program attempts to discover the maximum length
of a SQL statement in the tested database. The last time I tried it,
I was highly amused to watch the test program run out of memory and dump
core before Postgres did. (This was a couple years back, so maybe
they've fixed their problem by now.)

regards, tom lane