Re: TEXT datatype: compared to CHAR and VARCHAR
От | Einar Karttunen |
---|---|
Тема | Re: TEXT datatype: compared to CHAR and VARCHAR |
Дата | |
Msg-id | 20011123153309.C13842@shellak.helsinki.fi обсуждение исходный текст |
Ответ на | TEXT datatype: compared to CHAR and VARCHAR (Nikola Milutinovic <Nikola.Milutinovic@ev.co.yu>) |
Список | 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 по дате отправления: