8

I have a form where clients will be typing a few paragraphs in various textarea's. Should I choose varchar or text for field type? Does it matter?

Thanks.

Erik

Erik
  • 5,701
  • 27
  • 70
  • 119

3 Answers3

8

It depends on the possible length of text you accept. Text has no limitations at all, but that means you could end up with a giant, huge, ridiculous response size. On the other hand, if you're not worried about that, text is fine.

Varchar requires you to have some idea of how large you want the response to max out at, like 256, 1000, 4000 chars, for example. Any data above that is lost.

Jon Clements
  • 138,671
  • 33
  • 247
  • 280
6

For text that don't have a limit in size I normaly use text, and varchar when you have a maximum size defined.

Gustavo Vargas
  • 2,497
  • 2
  • 24
  • 32
1

Depends. Difference between varchar and text is that varchar is actually stored in row, when text is a pointer.

Varchar is mostly faster. Usually varchar is used when statement is not very long and has a limit. Text is used for large pieces of data.

Ruslan Osipov
  • 5,655
  • 4
  • 29
  • 44