Ask a Question related to PostgreSQL / PGSQL, Design and Development.
-
Sim Zacks #1
varchar vs text
Are there any differences between text and varchar? I found the following in
the docs, which leads me to believe that there are no differences at all.
Can someone please confirm this before I switch all my varchars to text?
Tip: There are no performance differences between these three types, apart
from the increased storage size when using the blank-padded type. While
character(n) has performance advantages in some other database systems, it
has no such advantages in PostgreSQL. In most situations text or character
varying should be used instead.
Sim Zacks Guest
-
text and varchar
Hello, sorry for the trivial question. Is there any difference between varchar and text types in practice? I couldn't find. Mage ... -
Question about varchar and text
What is the difference between varchar and text? I have heard that you can use text instead of varchar and this could speed up your tables. ... -
VARCHAR or not ?
Solaris 8 IDS 7.31 FD3 We have to create a table, that will contain a code, a short description and then a long description (up to 2000... -
cast problem -- int to varchar
Hello, I have the following cross tab query...I need to convert the EmployeeStatus from an int to a varchar datatype so I can describe the result... -
Conversion of Varbinary into varchar
Dear All, I have written a stored procedure which returns a Varbinary column from MS SQl Server 7 database. I tried converting the same into... -
Martijn van Oosterhout #2
Re: varchar vs text
On Tue, Jan 04, 2005 at 09:50:18AM +0200, Sim Zacks wrote:
Correct. The only difference between varchar and text is that varchar> Are there any differences between text and varchar? I found the followingin
> the docs, which leads me to believe that there are no differences at all.
> Can someone please confirm this before I switch all my varchars to text?
can have a maximum length, which will be checked. As for storage used,
indexability, operators, etc they're identical.
Hope this helps,
--
Martijn van Oosterhout <kleptog@svana.org> [url]http://svana.org/kleptog/[/url]-----BEGIN PGP SIGNATURE-----> Patent. n. Genius is 5% inspiration and 95% perspiration. A patent is a
> tool for doing 5% of the work and then sitting around waiting for someone
> else to do the other 95% so you can sue them.
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see [url]http://www.gnupg.org[/url]
iD8DBQFB3C4XY5Twig3Ge+YRAoyNAKCrU/oBnFNgN65tQ6X9KJ/UrSlwowCeJLyP
NyGjrUAcZM9wO8uH0r85zM0=
=MUxM
-----END PGP SIGNATURE-----
Martijn van Oosterhout Guest
-
howachen@gmail.com #3
Varchar VS Text
Hi,
Some people said that using Text as datatype is preferred and there is
no reason to use Varchar. Their claimed that that by using Text, no
length checking is needed as varchar, so the performance of using Text
is generally faster.
Anyone did the test before?
Thnaks for any comments.
howachen@gmail.com Guest
-
Axel Schwenke #4
Re: Varchar VS Text
[email]howachen@gmail.com[/email] wrote:
Who is "some people"? Some people may be stupid ;-)>
> Some people said
VARCHAR and TEXT types differ in some points. Read it here:> that using Text as datatype is preferred and there is
> no reason to use Varchar. Their claimed that that by using Text, no
> length checking is needed as varchar, so the performance of using Text
> is generally faster.
[url]http://dev.mysql.com/doc/refman/5.0/en/blob.html[/url]
The "length checking" argument is questionable, TEXT columns have
a length restriction too. I also doubt the performance argument
(but never measured this). BLOB and TEXT data is stored separately
from other row data so you have less locality on the storage when
accessing BLOB/TEXT data. So I would expect worse performance.
XL
--
Axel Schwenke, Senior Software Developer, MySQL AB
Online User Manual: [url]http://dev.mysql.com/doc/refman/5.0/en/[/url]
MySQL User Forums: [url]http://forums.mysql.com/[/url]
Axel Schwenke Guest



Reply With Quote

