Re: TEXT datatype: compared to CHAR and VARCHAR - Mailing list pgsql-general

From Einar Karttunen
Subject Re: TEXT datatype: compared to CHAR and VARCHAR
Date
Msg-id 20011123153309.C13842@shellak.helsinki.fi
Whole thread Raw
In response to TEXT datatype: compared to CHAR and VARCHAR  (Nikola Milutinovic <Nikola.Milutinovic@ev.co.yu>)
List pgsql-general
On 23.11.01 13:43 +0100(+0000), Nikola Milutinovic wrote:
> Hi all.
>
> One quick question. I have a doubt, should I use CHAR/VARCHAR or TEXT
> data types in my database?
>
> Two points are of most concern:
>
> - performance
> - compatibility
>
> Is VARCHAR faster for access/storing operations than TEXT? Since it
> specifies the max. amount of space, one would think that it is better...
>
> If I should choose to migrate my data to, say, Oracle, will TEXT field
> cause problems in any way? I would have to rewrite the schema
> definition, which can be painful for a larger database...
>
Text doesn't have a worse performance than varchar, but you don't
have to try to remember the limit yourself. Both of them are stored
as variable length data.

Mysql supports the text-datatype but you cannot use it as primary
key in certain table types. Oracle AFAIK doesn't support text.
You have to use varchar2(n) for n<4000, or else CLOB.

- Einar Karttunen


pgsql-general by date:

Previous
From: "Andrey Shcherbina"
Date:
Subject: PG vs MySQL
Next
From: "Hegyvari Krisztian"
Date:
Subject: rollback question