I'm having trouble getting any table with a text-type field to work. Perhaps if I had a bit more information about it I could figure it out.

What are the limitations and usage of the text data type?

Would it be wiser just to store large amounts of text in ascii files?

    Questions: (1) What version of PostgreSQL are you using? The newest should allow any reasonable-sized text to work fine (previous versions had an 8K-per-row size limitation.) (2) Exactly what do you mean by "large amounts" of text, and how many such records will you have? Storing large things in the filesystem can have its advantages, but the disadvantages in access time can be considerable if you don't do it right.

      Version: 7.0.2

      And, I just got it to work. I always got an error on table creation when I ran

      CREATE TABLE test
      (blah text (2000) NOT NULL );

      I just tried it without entering a length..

      CREATE TABLE test
      (blah text NOT NULL );

      ..and it worked fine.

      The page this is involved in is a news/updates page. I knew that the actual text content could range between a short paragraph to a few large ones. Since I couldn't get the text field to work, I had decided to use text files. Each news/update entry would have it's own single record in the database, and each text file would be named with the formatted year-month-day-hour-minute of the entry.

      I'm going to stick with the text files, as it allows for easier correction/editing.

      ...but the disadvantages in access time can >be considerable if you don't do it right.

      Could you explain what the right way might be? I have only a couple months experience with PHP, any knowledge is helpful.

        Write a Reply...