Re: PSQL Data Type: text vs. varchar(n)

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: PSQL Data Type: text vs. varchar(n)
Дата
Msg-id 3680.1143784291@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: PSQL Data Type: text vs. varchar(n)  ("Uwe C. Schroeder" <uwe@oss4u.com>)
Ответы Re: PSQL Data Type: text vs. varchar(n)  (Jim Nasby <jnasby@pervasive.com>)
Список pgsql-general
"Uwe C. Schroeder" <uwe@oss4u.com> writes:
> On Thursday 30 March 2006 21:27, Tom Lane wrote:
>> My own take on this is that you should "say what you mean".  If you do
>> not have a clear application-oriented reason for specifying a particular
>> limit N in varchar(N), you have no business choosing a random value of N
>> instead.  Use text, instead of making up an N.

> Tom, good point. However, if you design an application that at one point
> _might_ need to be run on something else than postgres (say oracle or DB2),
> your're way better off with a varchar than text.

Well, if you are looking for the lowest-common-denominator textual
column datatype, then varchar(255) is probably it ... I think even Bill
Gates would feel ashamed to sell a database that could not handle that.
But my reading of the OP's question was about whether there's a usefully
large value of N for which every available DB will take "varchar(N)".
I'm not real sure what the practical limit of N is in that question,
other than being pretty confident that Postgres isn't holding down
last place.  Comments anyone?

            regards, tom lane

В списке pgsql-general по дате отправления:

Предыдущее
От: Christopher Browne
Дата:
Сообщение: Re: [Slightly OT] data model books/resources?
Следующее
От: Chris
Дата:
Сообщение: Re: PSQL Data Type: text vs. varchar(n)