<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<small>Good morning, <br>
<br>
For performance point of view, are there big differences between:
char(N), varchar(N), varchar, text? <br>
</small>
<p><small>Some comments from google shows: <br>
No difference, under the hood it's all varlena. Check this
article from Depesz: <a
href="http://www.depesz.com/index.php/2010/03/02/charx-vs-varcharx-vs-varchar-vs-text/">http://www.depesz.com/index.php/2010/03/02/charx-vs-varcharx-vs-varchar-vs-text/</a><br>
A couple of highlights:</small></p>
<small>
</small>
<blockquote><small> </small>
<p><small>To sum it all up:</small></p>
<small> </small>
<ul>
<li><small>char(n) – takes too much space when dealing with
values shorter than n, and can lead to subtle errors because
of adding trailing spaces, plus it is problematic to change
the limit</small></li>
<li><small>varchar(n) – it's problematic to change the limit in
live environment</small></li>
<li><small>varchar – just like text</small></li>
<li><small>text – for me a winner – over (n) data types because
it lacks their problems, and over varchar – because it has
distinct name</small></li>
</ul>
<small>
So, can I assume no big performance differences? <br>
Thanks alot!<br>
Emi<br>
</small></blockquote>
</body>
</html>