Results 1 to 10 of 10
  1. #1
    Join Date
    Dec 2006
    Posts
    24

    Unanswered: Postgres max Rowlength

    i'm evaluating postgres as a successor of a MS SQL Database i administrate. It's serving Web-Applications (Apache & PHP based) that we are migrating to a Java based Application (J2EE/JSF).

    One of my problems is, that i need to store larger Text-Container for XML-Files. MS SQL has a 8060-char Limit on that, even for the whole row. I'll have to store thousands of XML-Documents, not constantly mappable on a fixed table-layout (Schema will be changed/updated frequently).Thats why i thought of varchar/text-Containers.

    As a result i need a professional database handling varchar/text-Colums with up to 16.000 chars. Searching the postgres-manual i found no clear statements on the maximal row-length or/and max length of varchar()-Columns in a RowSet!


    Any hints/links are welcome!


    thanx


    wegus
    an Apple a day keeps Dr. Watson away !

  2. #2
    Join Date
    Nov 2003
    Posts
    2,935
    Provided Answers: 12
    From the manual at
    http://www.postgresql.org/docs/8.2/s...character.html

    "In any case, the longest possible character string that can be stored is about 1 GB"

    "If you desire to store long strings with no specific upper limit, use text or character varying without a length specifier, rather than making up an arbitrary length limit."

  3. #3
    Join Date
    Dec 2006
    Posts
    24
    that's what i read too!

    i fear that there might be a conflict on a possible limit for the complete row! In fact i never need more then 16000 characters i suppose. has anybody tested things like that yet? I'll gonna start a test on my own. In any case it would be usefull to learn about known issues or limitations.
    an Apple a day keeps Dr. Watson away !

  4. #4
    Join Date
    Nov 2003
    Posts
    2,935
    Provided Answers: 12
    Quote Originally Posted by wegus
    i fear that there might be a conflict on a possible limit for the complete row!
    Why should they claim to support 1GB for a single column if that exceeded the max row length?

    The FAQ says the maximum row length is 400GB
    http://www.postgresql.org/docs/faqs.FAQ.html#item4.4

  5. #5
    Join Date
    Dec 2006
    Posts
    24
    as i said i used MS SQL

    MS SQL sais up to 8000 characters for varchar
    .
    .
    .
    and max 8000 charcters per row ( which keeps tables quite simple )

    that's why i am a bit concerned on this topic! While typing this i'm already testing with postgres...
    Last edited by wegus; 03-09-07 at 07:20.
    an Apple a day keeps Dr. Watson away !

  6. #6
    Join Date
    Nov 2003
    Posts
    2,935
    Provided Answers: 12
    Quote Originally Posted by wegus
    that's why i am a bit concerned on this topic!
    That's why I would never user MS SQL Server

  7. #7
    Join Date
    Dec 2006
    Posts
    24
    as you can see: i am learning
    an Apple a day keeps Dr. Watson away !

  8. #8
    Join Date
    Jun 2004
    Location
    Arizona, USA
    Posts
    1,848
    I BELIEVE that pg has a 4K limit for char fields and 1 GB for Varchar fields. Note: the 4K limit can be extended by changing a constant in the source & a compile/link
    Lou
    使大吃一惊
    "Lisa, in this house, we obey the laws of thermodynamics!" - Homer Simpson
    "I have my standards. They may be low, but I have them!" - Bette Middler
    "It's a book about a Spanish guy named Manual. You should read it." - Dilbert


  9. #9
    Join Date
    Nov 2003
    Posts
    2,935
    Provided Answers: 12
    Quote Originally Posted by loquin
    I BELIEVE that pg has a 4K limit for char fields and 1 GB for Varchar fields.
    Well, the manuals says differently.
    And then: who would ever want to use the CHAR datatype with anything else than CHAR(1)??

  10. #10
    Join Date
    Jun 2004
    Location
    Arizona, USA
    Posts
    1,848
    I mis-spoke. I was actually thinking about row size limits, (and not char limits) which in early versions of postgresql were limited to 4K or 8K in size, although you could recompile with larger limits.


    As you age, memory loss is a ... err... what was I saying?
    Last edited by loquin; 05-14-07 at 17:22.
    Lou
    使大吃一惊
    "Lisa, in this house, we obey the laws of thermodynamics!" - Homer Simpson
    "I have my standards. They may be low, but I have them!" - Bette Middler
    "It's a book about a Spanish guy named Manual. You should read it." - Dilbert


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •