What is the maximum query length in postgresql?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • osman7king
    New Member
    • Sep 2010
    • 61

    What is the maximum query length in postgresql?

    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?
  • rski
    Recognized Expert Contributor
    • Dec 2006
    • 700

    #2
    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

    Comment

    • osman7king
      New Member
      • Sep 2010
      • 61

      #3
      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.

      Comment

      • rski
        Recognized Expert Contributor
        • Dec 2006
        • 700

        #4
        In postgres source code there are lots of statements where query text (sourceText) is defined as 'const char *', see below
        Code:
        static void
        ProcessQuery(PlannedStmt *plan,
                      const char *sourceText,
                      ParamListInfo params,
                      DestReceiver *dest,
                      char *completionTag)
        So I assume that max query lenght is not 'hard coded'

        Comment

        Working...