By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
431,871 Members | 2,464 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 431,871 IT Pros & Developers. It's quick & easy.

What is the maximum query length in postgresql?

P: 61
If I want to generate dynamically some queries in a php 5 application to retrieve information from an postgresql database. is there a maximum length for this query?

When i use the IN statement, how many values can I use in?
Oct 18 '10 #1
Share this Question
Share on Google+
3 Replies


Expert 100+
P: 700
I don't think there is a query length limit, I did't hear about it. Did you meet any problems with such 'big' IN statement
Oct 20 '10 #2

P: 61
In Oracle database the maximum size of SQL statement is
about 4000 characters, I want to know what about PostgreSQL
(of course it more more than 4000 characters, but is there any
number for the max size of a query?

thanks a lot.
Oct 21 '10 #3

Expert 100+
P: 700
In postgres source code there are lots of statements where query text (sourceText) is defined as 'const char *', see below
Expand|Select|Wrap|Line Numbers
  1. static void
  2. ProcessQuery(PlannedStmt *plan,
  3.               const char *sourceText,
  4.               ParamListInfo params,
  5.               DestReceiver *dest,
  6.               char *completionTag)
  7.  
So I assume that max query lenght is not 'hard coded'
Nov 14 '10 #4

Post your reply

Sign in to post your reply or Sign up for a free account.