This week's giveaway is in the EJB and other Java EE Technologies forum. We're giving away four copies of EJB 3 in Action and have Debu Panda, Reza Rahman, Ryan Cuprak, and Michael Remijan on-line! See this thread for details.
I have to store string of variable lengths in our postgres database.. Strings could be too long
SO can anyone please tell me the pros and crons of the type text(unlimited length), or should i go for some other way to store the string
This forum uses "text" in postgres to store forum posts. It's similar to the CLOB type in other databases.
The only warning I can think of is that it is good practice to store the text/CLOB type in a table separate from your main data. For example, the jforum_posts table has about 20 columns including a post_id, but not the big field. The jforum_posts_text table has only two columns: post_id and text.
The reason for this is so the database has more rows in each "page" on memory from the main table and can more quickly execute filters (the where clause) against it.